This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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))
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]