Fix windres memory leak
authorChen Gang <gang.chen.5i5j@gmail.com>
Tue, 9 Dec 2014 07:00:40 +0000 (17:30 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 9 Dec 2014 07:01:55 +0000 (17:31 +1030)
* windres.c (open_file_search): Free path buffer on failure.

binutils/ChangeLog
binutils/windres.c

index a1ce578ccaf9e03e47a16a9ce34ec3b79760d4e8..7404a15df0fd25d69f0c8efbe3b4b56e053b9530 100644 (file)
@@ -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
index 7fa90fc7f78d8c5581ef550ccc612386737bf3f8..14cf11e66b15560bcd7104b975d8b3a0e190a5ca 100644 (file)
@@ -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;