This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
objcopy memory leak
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 15 Nov 2017 22:29:13 +1030
- Subject: objcopy memory leak
- Authentication-results: sourceware.org; auth=none
PR 22426
* objcopy.c (copy_main): Free tmpname.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index e5df1a9..c45133b 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -5301,6 +5301,9 @@ copy_main (int argc, char *argv[])
else
unlink_if_ordinary (tmpname);
+ if (tmpname != output_filename)
+ free (tmpname);
+
if (change_warn)
{
struct section_list *p;
--
Alan Modra
Australia Development Lab, IBM