From b862ce75d2a1ac6b86812c7e512152e154e83ea6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 30 May 2013 17:14:35 +0000 Subject: [PATCH] fix py-breakpoint.c One return path in bppy_get_commands was missing a do_cleanups call. * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups along all return paths. --- gdb/ChangeLog | 5 +++++ gdb/python/py-breakpoint.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b9e8dd..2588d05 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-05-30 Tom Tromey + * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups + along all return paths. + +2013-05-30 Tom Tromey + * cli/cli-logging.c (set_logging_redirect): Unconditionally call do_cleanups. diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index d958f30..eaa1bc5 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -489,7 +489,11 @@ bppy_get_commands (PyObject *self, void *closure) print_command_lines (current_uiout, breakpoint_commands (bp), 0); } ui_out_redirect (current_uiout, NULL); - GDB_PY_HANDLE_EXCEPTION (except); + if (except.reason < 0) + { + do_cleanups (chain); + GDB_PY_HANDLE_EXCEPTION (except); + } cmdstr = ui_file_xstrdup (string_file, &length); make_cleanup (xfree, cmdstr); -- 2.7.4