public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* objdump -G memory leak
@ 2023-02-15 11:34 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-02-15 11:34 UTC (permalink / raw)
  To: binutils

	* objdump.c (find_stabs_section): Free stabs.

diff --git a/binutils/objdump.c b/binutils/objdump.c
index 9dd1ebd4da0..8a8bfba5c76 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -4603,7 +4603,10 @@ find_stabs_section (bfd *abfd, asection *section, void *names)
 	{
 	  stabs = read_section_stabs (abfd, section->name, &stab_size, NULL);
 	  if (stabs)
-	    print_section_stabs (abfd, section->name, &sought->string_offset);
+	    {
+	      print_section_stabs (abfd, section->name, &sought->string_offset);
+	      free (stabs);
+	    }
 	}
     }
 }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-15 11:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 11:34 objdump -G memory leak 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).