OSDN Git Service

2010-11-13 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 2010 18:49:07 +0000 (18:49 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 2010 18:49:07 +0000 (18:49 +0000)
        * lto-plugin.c (add_output_files): Fix memory leak.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166718 138bc75d-0d04-0410-961f-82ee72b054a4

lto-plugin/ChangeLog
lto-plugin/lto-plugin.c

index 3db5448..95b6f5e 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-13  Kai Tietz  <kai.tietz@onevision.com>
+
+       * lto-plugin.c (add_output_files): Fix memory leak.
+
 2010-11-11  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        PR bootstrap/46397
index 78eb109..d283028 100644 (file)
@@ -461,7 +461,10 @@ add_output_files (FILE *f)
       buf = s;
 cont:
       if (!fgets (buf, piece, f))
-       break;
+       {
+         free (s);
+         break;
+       }
       len = strlen (s);
       if (s[len - 1] != '\n')
        {