+2013-05-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * 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.
+
2013-05-04 Eli Zaretskii <eliz@gnu.org>
* windows-nat.c (windows_delete_thread): Accept an additional
rl_callback_handler_remove(), does the job. */
rl_callback_handler_remove ();
+ do_cleanups (old_chain);
return;
}
else
if (!stop_regs)
{
stop_regs = regcache_dup (get_current_regcache ());
- cleanup = make_cleanup_regcache_xfree (stop_regs);
+ make_cleanup_regcache_xfree (stop_regs);
}
gdbarch = get_regcache_arch (stop_regs);
bfd *sym_bfd;
int desc;
char *absolute_name;
+ struct cleanup *back_to;
if (remote_filename_p (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))
bfd_errmsg (bfd_get_error ()));
}
+ do_cleanups (back_to);
+
return sym_bfd;
}