c56bb631c4
If store_stem() fails to expand the memory allocated on data->stem_arr, some things go wrong: * the memory referenced by "buf" is leaked, * data->alloc_stems has been increased without data->stem_arr having been expanded. So the next time store_stem() is called, the function will behave as if the buffer holds enough space, and will write data after the end of data->stem_arr. The first issue is being spotted by clang's static analyzer, which warns about leaking variable "stem" in find_stem_from_spec() (this function calls store_stem()). This both issues by freeing buf when realloc(data->stem_arr) fails, and by not increasing data->alloc_stems when this happens. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org> |
||
---|---|---|
.. | ||
include | ||
man | ||
src | ||
utils | ||
LICENSE | ||
Makefile | ||
VERSION |