summaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:14:34 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:14:34 +0000
commit45e4ebaf10de18859d5b1160854b4b4f9fc7593e (patch)
tree2b1639d6433c7427d4cbd0dc282aaea008f2ae17 /gdb/python
parent40228b361e712cd089fff53b7156e2dbfa5181b4 (diff)
downloadgdb-45e4ebaf10de18859d5b1160854b4b4f9fc7593e.tar.gz
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')
-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 d958f303341..eaa1bc52738 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);