aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-12-09 17:30:40 +1030
committerAlan Modra <amodra@gmail.com>2014-12-09 17:31:55 +1030
commit137d1369ac054744d27f19e95aa8a739e6c0068d (patch)
treec780e7a1b174b19b677d1fd063f911a4f56b91f4 /binutils
parent77ab336ea162fa8d7a9a9e005d7e2865a210b375 (diff)
downloadgdb-137d1369ac054744d27f19e95aa8a739e6c0068d.zip
gdb-137d1369ac054744d27f19e95aa8a739e6c0068d.tar.gz
gdb-137d1369ac054744d27f19e95aa8a739e6c0068d.tar.bz2
Fix windres memory leak
* windres.c (open_file_search): Free path buffer on failure.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/windres.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index a1ce578..7404a15 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-09 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ * windres.c (open_file_search): Free path buffer on failure.
+
2014-12-08 Nick Clifton <nickc@redhat.com>
PR binutils/17531
diff --git a/binutils/windres.c b/binutils/windres.c
index 7fa90fc..14cf11e 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -204,6 +204,7 @@ open_file_search (const char *filename, const char *mode, const char *errmsg,
*real_filename = n;
return e;
}
+ free (n);
if (errno != ENOENT)
break;