public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix small objcopy memory leak
@ 2022-10-29  4:52 Alan Modra
  2022-10-31  9:24 ` Michael Tokarev
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2022-10-29  4:52 UTC (permalink / raw)
  To: binutils

	* objcopy.c (copy_archive): Free l->name.

diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index d20aaef9f4f..03350babb69 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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);
       }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-31 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29  4:52 Fix small objcopy memory leak Alan Modra
2022-10-31  9:24 ` Michael Tokarev
2022-10-31 10:18   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).