PR25362, memory leak in nm

Alan Modra amodra@gmail.com
Mon Jan 13 12:09:00 GMT 2020


	PR 25362
	* nm.c (display_rel_file): Free dyn_syms.

diff --git a/binutils/nm.c b/binutils/nm.c
index 99d2027250..0ee3f88386 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1171,6 +1171,8 @@ display_rel_file (bfd *abfd, bfd *archive_bfd)
 	  *symp = 0;
 	  symcount += synth_count;
 	}
+      if (!dynamic && dyn_syms != NULL)
+	free (dyn_syms);
     }
 
   /* lto_slim_object is set to false when a bfd is loaded with a compiler

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list