This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

objcopy memory leak


	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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]