Fix small objcopy memory leak
authorAlan Modra <amodra@gmail.com>
Sat, 29 Oct 2022 00:12:50 +0000 (10:42 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 29 Oct 2022 04:53:58 +0000 (15:23 +1030)
* objcopy.c (copy_archive): Free l->name.

binutils/objcopy.c

index d20aaef9f4f2e2a910bd7bf666dab6e3c158fc1b..03350babb69c7c757029b1ad83a2987fadcb6460 100644 (file)
@@ -3744,6 +3744,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
            bfd_close (l->obfd);
            unlink (l->name);
          }
+       free ((char *) l->name);
        next = l->next;
        free (l);
       }