aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-28 18:55:22 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-28 18:55:22 +0000
commite463f5879168996be4cc644d947f7eeb24b319aa (patch)
treed381fe1014393e9d9b19ad4dc8cefce24ab5573e
parentc38eea1ac5c05edb0dd52cfe35d1cc6f84b8d0f3 (diff)
downloadgdb-e463f5879168996be4cc644d947f7eeb24b319aa.zip
gdb-e463f5879168996be4cc644d947f7eeb24b319aa.tar.gz
gdb-e463f5879168996be4cc644d947f7eeb24b319aa.tar.bz2
2011-02-28 Michael Snyder <msnyder@vmware.com>
* python/py-cmd.c (cmdpy_init): Fix memory leak.
-rw-r--r--gdb/ChangeLog2
-rw-r--r--gdb/python/py-cmd.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c6f218e..172625b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 245d66a..c0e3291 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -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))
{