[Bug analyzer/93032] analyzer fails to detect FILE * leak in zlib/contrib/minizip/mztools.c
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 21 16:01:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93032
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
I'm not convinced that the above patch is correct. What if one or two of the
fopen calls fail? Then the else branch of the "if" will be followed, and no
fclose will be called on the fp for the calls that succeeded.
I have a patch that enables the analyzer to report three leaks, based on the
above (for each of the fopen calls succeeding where one of the others fails).
More information about the Gcc-bugs
mailing list