Skip to content

Commit 2d53b52

Browse files
committed
supress static analyzer issue on msvc
1 parent 6b2a85d commit 2d53b52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/jc_test.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,10 @@ struct jc_buffered_string
939939
void Grow(size_t _size)
940940
{
941941
capacity += _size;
942+
#if defined(_MSC_VER)
943+
// C6308: realloc may return null and overwrite the original pointer, causing a leak.
944+
#pragma warning(suppress:6308)
945+
#endif
942946
buffer = (char*)realloc(buffer, capacity);
943947
assert(buffer != 0);
944948
}

0 commit comments

Comments
 (0)