summaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-13 18:49:07 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-13 18:49:07 +0000
commit975b6791235ee92d2dcd19b7dad0e9c27a209693 (patch)
tree8d326af60f8ac3e9bc3bf53afe4ac560e49178b2 /lto-plugin
parentbe2831f4272ccc0d82dcda9481d39759b584ccf7 (diff)
downloadgcc-975b6791235ee92d2dcd19b7dad0e9c27a209693.tar.gz
2010-11-13 Kai Tietz <kai.tietz@onevision.com>
* 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
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog4
-rw-r--r--lto-plugin/lto-plugin.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 3db5448ba25..95b6f5efbe9 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -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
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 78eb1098837..d2830283f6f 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -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')
{