2011-02-28 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Mon, 28 Feb 2011 18:55:22 +0000 (18:55 +0000)
committerMichael Snyder <msnyder@vmware.com>
Mon, 28 Feb 2011 18:55:22 +0000 (18:55 +0000)
* python/py-cmd.c (cmdpy_init): Fix memory leak.

gdb/ChangeLog
gdb/python/py-cmd.c

index c6f218e1dd3a2817f435a970096f7be41a9c44c1..172625b371c8cd5add7709556042e2ed2524caaf 100644 (file)
@@ -1,5 +1,7 @@
 2011-02-28  Michael Snyder  <msnyder@vmware.com>
 
+       * python/py-cmd.c (cmdpy_init): Fix memory leak.
+
        * breakpoint.c (catch_syscall_completer): Free malloced list.
 
        * jv-lang.c (java_primitive_type_from_name): Add missing break.
index 245d66a3fecf41c59c67ea6cd1a3138dc8260a57..c0e32914110228998ddc416589461342c2501332 100644 (file)
@@ -481,7 +481,10 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
          pfx_name[out] = '\0';
        }
       else if (cmp < 0)
+       {
+         xfree (cmd_name);
          return -1;
+       }
     }
   if (PyObject_HasAttr (self, gdbpy_doc_cst))
     {