diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-30 17:06:31 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-30 17:06:31 +0000 |
commit | e42d0aa5bac43efc5556ca0e6ad18effd04de4ea (patch) | |
tree | 34e4bee96cd47f5faa976088bbb1a3cd09c7c184 /gdb/machoread.c | |
parent | fix cleanup handling in m32r_load (diff) | |
download | binutils-gdb-e42d0aa5bac43efc5556ca0e6ad18effd04de4ea.tar.gz binutils-gdb-e42d0aa5bac43efc5556ca0e6ad18effd04de4ea.tar.bz2 binutils-gdb-e42d0aa5bac43efc5556ca0e6ad18effd04de4ea.zip |
fix cleanup handling in macho_symfile_read
macho_symfile_read leaks a cleanup by assigning to 'back_to' too late.
* machoread.c (macho_symfile_read): Assign first cleanup to
'back_to'.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r-- | gdb/machoread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c index 9877f07b4d3..d294960f63d 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); - make_cleanup (xfree, symbol_table); + back_to = make_cleanup (xfree, symbol_table); init_minimal_symbol_collection (); - back_to = make_cleanup_discard_minimal_symbols (); + make_cleanup_discard_minimal_symbols (); symcount = bfd_canonicalize_symtab (objfile->obfd, symbol_table); |