2011-03-05 Michael Snyder <msnyder@vmware.com>

* elfread.c (elf_symtab_read): Stop memory leak.
This commit is contained in:
Michael Snyder 2011-03-07 19:44:19 +00:00
parent e6040cbdcd
commit 69feea6fe7
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2011-03-06 Michael Snyder <msnyder@vmware.com>
* elfread.c (elf_symtab_read): Stop memory leak.
* main.c (captured_main): Fix memory leak.
2011-03-07 Andreas Schwab <schwab@linux-m68k.org>

View File

@ -243,6 +243,7 @@ elf_symtab_read (struct objfile *objfile, int type,
char *filesymname = "";
struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info;
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
for (i = 0; i < number_of_symbols; i++)
{
@ -464,6 +465,7 @@ elf_symtab_read (struct objfile *objfile, int type,
+ (sizeof (CORE_ADDR) * max_index));
sectinfo = (struct stab_section_info *)
xmalloc (size);
make_cleanup (xfree, sectinfo);
memset (sectinfo, 0, size);
sectinfo->num_sections = max_index;
if (filesym == NULL)
@ -572,6 +574,7 @@ elf_symtab_read (struct objfile *objfile, int type,
}
}
}
do_cleanups (back_to);
}
struct build_id