aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile-mem.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-30 18:48:19 +0000
committerTom Tromey <tromey@redhat.com>2011-06-30 18:48:19 +0000
commit3bb47e8bce4c147142b298c5c23368ba189105bc (patch)
tree3c690a64aeedd9d72f9cedc4a687491d80ba2f40 /gdb/symfile-mem.c
parent4727bad393ed5ccd73480968cbf3c4f5003542bc (diff)
downloadgdb-3bb47e8bce4c147142b298c5c23368ba189105bc.zip
gdb-3bb47e8bce4c147142b298c5c23368ba189105bc.tar.gz
gdb-3bb47e8bce4c147142b298c5c23368ba189105bc.tar.bz2
* symfile-mem.c (symbol_file_add_from_memory): Call do_cleanups.
* solib-svr4.c (open_symbol_file_object): Call do_cleanups on all return paths. Defer final do_cleanups until last return. * arm-tdep.c (arm_exidx_new_objfile): Make null cleanup after early return.
Diffstat (limited to 'gdb/symfile-mem.c')
-rw-r--r--gdb/symfile-mem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index 6da5a1c..bef28c7 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -72,6 +72,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
bfd_vma loadbase;
struct section_addr_info *sai;
unsigned int i;
+ struct cleanup *cleanup;
if (bfd_get_flavour (templ) != bfd_target_elf_flavour)
error (_("add-symbol-file-from-memory not supported for this target"));
@@ -97,7 +98,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
}
sai = alloc_section_addr_info (bfd_count_sections (nbfd));
- make_cleanup (xfree, sai);
+ cleanup = make_cleanup (xfree, sai);
i = 0;
for (sec = nbfd->sections; sec != NULL; sec = sec->next)
if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
@@ -114,6 +115,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
+ do_cleanups (cleanup);
return objf;
}