diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-05-05 16:54:26 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-05-05 16:54:26 +0000 |
commit | cbc2f1cd213ffcc8d77dbed2654f5eb013182f2f (patch) | |
tree | ce39f8bd873e33362930059e40fc246ec6a7bd06 /gdb/symfile.c | |
parent | 548fe3aeed52402480a707202c78933b7f0d3748 (diff) | |
download | gdb-cbc2f1cd213ffcc8d77dbed2654f5eb013182f2f.tar.gz |
gdb/
* event-top.c (display_gdb_prompt): Call missing do_cleanups.
* infcmd.c (get_return_value) <!stop_regs>: Do not overwrite CLEANUP.
* symfile.c (symfile_bfd_open): New variable back_to. Do not leave
a stale cleanup. Fix double free of NAME.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 979a8dd0a51..13740df0ea1 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1698,6 +1698,7 @@ symfile_bfd_open (char *name) bfd *sym_bfd; int desc; char *absolute_name; + struct cleanup *back_to; if (remote_filename_p (name)) { @@ -1739,15 +1740,12 @@ symfile_bfd_open (char *name) xfree (name); name = absolute_name; - make_cleanup (xfree, name); + back_to = make_cleanup (xfree, name); sym_bfd = gdb_bfd_open (name, gnutarget, desc); if (!sym_bfd) - { - make_cleanup (xfree, name); - error (_("`%s': can't open to read symbols: %s."), name, - bfd_errmsg (bfd_get_error ())); - } + error (_("`%s': can't open to read symbols: %s."), name, + bfd_errmsg (bfd_get_error ())); bfd_set_cacheable (sym_bfd, 1); if (!bfd_check_format (sym_bfd, bfd_object)) @@ -1757,6 +1755,8 @@ symfile_bfd_open (char *name) bfd_errmsg (bfd_get_error ())); } + do_cleanups (back_to); + return sym_bfd; } |