aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-11 21:34:34 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-11 21:34:34 +0000
commit4c2d572468f9adde02d19abeda30ce76390cbaad (patch)
tree12b83dd1045a60b3d96feec91e1dd16f210439d3 /gdb/python
parent6dc3565dc43f1438fd234744a53c7ebc281d2b35 (diff)
downloadgdb-4c2d572468f9adde02d19abeda30ce76390cbaad.zip
gdb-4c2d572468f9adde02d19abeda30ce76390cbaad.tar.gz
gdb-4c2d572468f9adde02d19abeda30ce76390cbaad.tar.bz2
2011-02-27 Michael Snyder <msnyder@vmware.com>
* python/py-breakpoint.c (bppy_get_commands): Fix memory leak.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index bfad002..c8308b9 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -489,12 +489,12 @@ bppy_get_commands (PyObject *self, void *closure)
print_command_lines (uiout, breakpoint_commands (bp), 0);
}
ui_out_redirect (uiout, NULL);
- cmdstr = ui_file_xstrdup (string_file, &length);
GDB_PY_HANDLE_EXCEPTION (except);
+ cmdstr = ui_file_xstrdup (string_file, &length);
+ make_cleanup (xfree, cmdstr);
result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL);
do_cleanups (chain);
- xfree (cmdstr);
return result;
}