This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gcov-profile/49333] [cppcheck][PATCH] found a resource leak in gcc/gcc/gcov-io.c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49333

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-06-08 22:47:16 UTC ---
(In reply to comment #2)
> Oh the second hunk of the patch is very bad as it closes a file descriptor that
> has an associated FILE to it.

I should say the FILE is still open and used after the function returns.   I
think you need to add another rule about fdopen causing the fd to become able
to close via fclose.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]