This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[cppcheck] found a resource leak in trunk/gcc/java/resource.c
- From: "Martin Ettl" <ettl dot martin at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 16 Jan 2010 15:07:48 +0100
- Subject: [cppcheck] found a resource leak in trunk/gcc/java/resource.c
Hi,
during check of the current trunk with the static code analysis tool cppcheck (https://sourceforge.net/projects/cppcheck/) i discovered a resource leak. Please see the attached patch that fixes the issue.
Best regards
Ettl Martin
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Index: resource.c
===================================================================
--- resource.c (Revision 155960)
+++ resource.c (Arbeitskopie)
@@ -139,6 +139,7 @@
|| ! S_ISREG (stat_buf.st_mode))
{
perror ("Could not figure length of resource file");
+ close (fd);
return;
}
buffer = XNEWVEC (char, strlen (name) + stat_buf.st_size);