This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] py-cmd.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:05:06 -0800
- Subject: [RFA] py-cmd.c, fix memory leak
2011-02-27 Michael Snyder <msnyder@vmware.com>
* python/py-cmd.c (cmdpy_init): Fix memory leak.
Index: python/py-cmd.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-cmd.c,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 py-cmd.c
--- python/py-cmd.c 26 Jan 2011 20:53:45 -0000 1.12
+++ python/py-cmd.c 27 Feb 2011 23:03:29 -0000
@@ -481,7 +481,10 @@ cmdpy_init (PyObject *self, PyObject *ar
pfx_name[out] = '\0';
}
else if (cmp < 0)
+ {
+ xfree (cmd_name);
return -1;
+ }
}
if (PyObject_HasAttr (self, gdbpy_doc_cst))
{