This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] python/py-breakpoint.c, fix memory leak
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 27 Feb 2011 15:18:24 -0800
- Subject: [RFA] python/py-breakpoint.c, fix memory leak
2011-02-27 Michael Snyder <msnyder@vmware.com>
* python/py-breakpoint.c (bppy_get_commands): Fix memory leak.
Index: python/py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-breakpoint.c,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 py-breakpoint.c
--- python/py-breakpoint.c 4 Feb 2011 21:54:16 -0000 1.14
+++ python/py-breakpoint.c 27 Feb 2011 23:16:20 -0000
@@ -489,9 +489,9 @@ bppy_get_commands (PyObject *self, void
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);
result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL);
do_cleanups (chain);
xfree (cmdstr);