This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
{patch lto-plugin]: Fix memory leak
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: ccoutant at google dot com
- Date: Sat, 13 Nov 2010 19:41:13 +0100
- Subject: {patch lto-plugin]: Fix memory leak
Hello,
I noticed a memory leak in add_output_files in lto-plugin.c file.
ChangeLog
2010-11-13 Kai Tietz
* lto-plugin.c (add_output_files): Fix memory leak.
Tested for x86_64-w64-mingw32, i686-w64-mingw32, and i686-pc-cygwin.
Ok for apply?
Regards,
Kai
--
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: lto-plugin.c
===================================================================
--- lto-plugin.c (revision 166701)
+++ lto-plugin.c (working copy)
@@ -461,7 +461,10 @@
buf = s;
cont:
if (!fgets (buf, piece, f))
- break;
+ {
+ free (s);
+ break;
+ }
len = strlen (s);
if (s[len - 1] != '\n')
{