PR25362, memory leak in nm

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

PR25362, memory leak in nm

Alan Modra-3
        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