Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 64a4e3e

Browse files
committed
[CID 125394] Use correct deallocator for IO_read_cstring_legacy result
`IO_read_cstring_legacy()` allocates the buffer it returns using `MCMemoryAllocate()`. Coverity-ID: 125394
1 parent e67714e commit 64a4e3e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

engine/src/block.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@ IO_stat MCBlock::load(IO_handle stream, uint32_t version, bool is_ext)
266266
// so load, delete and unset the flag.
267267
// MW-2013-11-19: [[ UnicodeFileFormat ]] The storage of this is ignored,
268268
// so is legacy,
269-
char *backcolorname;
270-
if ((stat = IO_read_cstring_legacy(backcolorname, stream, 2)) != IO_NORMAL)
269+
if ((stat = IO_discard_cstring_legacy(stream, 2)) != IO_NORMAL)
271270
return checkloadstat(stat);
272-
delete backcolorname;
273271
flags &= ~F_HAS_BACK_COLOR_NAME;
274272
}
275273
}

0 commit comments

Comments
 (0)