2011-03-07 Michael Snyder * readelf.c (process_gnu_liblist): Stop memory leak. Index: readelf.c =================================================================== RCS file: /cvs/src/src/binutils/readelf.c,v retrieving revision 1.534 diff -u -p -r1.534 readelf.c --- readelf.c 1 Mar 2011 00:02:32 -0000 1.534 +++ readelf.c 8 Mar 2011 01:27:07 -0000 @@ -11807,7 +11811,7 @@ process_gnu_liblist (FILE * file) Elf_Internal_Shdr * section; Elf_Internal_Shdr * string_sec; Elf32_External_Lib * elib; - char * strtab; + char * strtab = NULL; size_t strtab_size; size_t cnt; unsigned i; @@ -11833,6 +11837,7 @@ process_gnu_liblist (FILE * file) break; string_sec = section_headers + section->sh_link; + free (strtab); strtab = (char *) get_data (NULL, file, string_sec->sh_offset, 1, string_sec->sh_size, _("liblist string table")); @@ -11886,6 +11891,7 @@ process_gnu_liblist (FILE * file) } } + free (strtab); return 1; }