summaryrefslogtreecommitdiff
path: root/gdb/machoread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-06-03 13:22:29 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-06-03 13:22:29 +0000
commitf6aea118f840ab0df3071dd19eaeea472a15a5ef (patch)
tree4d5fed61b71590bd3e263a380d2691899c93014b /gdb/machoread.c
parentfa549f3baada1dee1b69af1b4db60f8f04bcfae0 (diff)
Revert "fix cleanup handling in macho_symfile_read"
This patch indirectly causes a SEGV by creating a dangling pointer. Reverting this patch while working on a clearer memory management method for this part of the code. gdb/Changelog: Revert: * machoread.c (macho_symfile_read): Assign first cleanup to 'back_to'.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r--gdb/machoread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c
index d294960f63..9877f07b4d 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -871,10 +871,10 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags)
struct cleanup *back_to;
symbol_table = (asymbol **) xmalloc (storage_needed);
- back_to = make_cleanup (xfree, symbol_table);
+ make_cleanup (xfree, symbol_table);
init_minimal_symbol_collection ();
- make_cleanup_discard_minimal_symbols ();
+ back_to = make_cleanup_discard_minimal_symbols ();
symcount = bfd_canonicalize_symtab (objfile->obfd, symbol_table);