objcopy: Close some memory leaks in error paths
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 11 Aug 2016 15:04:59 +0000 (16:04 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 4 Nov 2016 22:13:06 +0000 (22:13 +0000)
Closes some memory leaks within objcopy for error paths.

binutils/ChangeLog:

* objcopy.c (copy_section): Add extra calls to free for error
paths.

binutils/ChangeLog
binutils/objcopy.c

index f1e1f9bd3f20931d35ccb4027c716b17322ae639..09f76b92212fe90d004d190754e836e60a799348 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-04  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * objcopy.c (copy_section): Add extra calls to free for error
+       paths.
+
 2016-11-04  Tom Tromey  <tom@tromey.com>
 
        * dwarf-mode.el (dwarf-browse): Set default-directory.  Bump
index 1821c0ce1be5c1cd39106b9b9fe67fa22c8a6c21..d40cfcb2bb605486d5f6134d3804471acc8a0bc8 100644 (file)
@@ -3375,6 +3375,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
        {
          status = 1;
          bfd_nonfatal_message (NULL, ibfd, isection, NULL);
+         free (memhunk);
          return;
        }
 
@@ -3428,6 +3429,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
        {
          status = 1;
          bfd_nonfatal_message (NULL, obfd, osection, NULL);
+         free (memhunk);
          return;
        }
       free (memhunk);
@@ -3449,6 +3451,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
        {
          status = 1;
          bfd_nonfatal_message (NULL, obfd, osection, NULL);
+         free (memhunk);
          return;
        }
       free (memhunk);
This page took 0.027931 seconds and 4 git commands to generate.