objdump -G memory leak

Alan Modra amodra@gmail.com
Wed Feb 15 11:34:16 GMT 2023


	* 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


More information about the Binutils mailing list