This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[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);

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