objcopy: Close some memory leaks in error paths
[deliverable/binutils-gdb.git] / binutils / objcopy.c
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.024893 seconds and 4 git commands to generate.