objdump -G memory leak
authorAlan Modra <amodra@gmail.com>
Wed, 15 Feb 2023 08:13:20 +0000 (18:43 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 15 Feb 2023 11:33:30 +0000 (22:03 +1030)
* objdump.c (find_stabs_section): Free stabs.

binutils/objdump.c

index 9dd1ebd4da0a332ec5d3649aac56111df9ad6010..8a8bfba5c768bcb82f81042c6326e572b2772b59 100644 (file)
@@ -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);
+           }
        }
     }
 }