aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:14:35 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:14:35 +0000
commitb862ce75d2a1ac6b86812c7e512152e154e83ea6 (patch)
tree232886951166426a8651c398a494bd5156b3fd36 /gdb/python/py-breakpoint.c
parente12fefc804bcbe2d53554390b76f07005632a526 (diff)
downloadgdb-b862ce75d2a1ac6b86812c7e512152e154e83ea6.zip
gdb-b862ce75d2a1ac6b86812c7e512152e154e83ea6.tar.gz
gdb-b862ce75d2a1ac6b86812c7e512152e154e83ea6.tar.bz2
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.
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c6
1 files changed, 5 insertions, 1 deletions
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);