From e463f5879168996be4cc644d947f7eeb24b319aa Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Mon, 28 Feb 2011 18:55:22 +0000 Subject: 2011-02-28 Michael Snyder * python/py-cmd.c (cmdpy_init): Fix memory leak. --- gdb/python/py-cmd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/python') diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 245d66a3fec..c0e32914110 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)) { -- cgit v1.2.1