This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 10/28] add decref to cmdpy_init
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 19 Apr 2013 08:32:20 -0600
- Subject: [PATCH 10/28] add decref to cmdpy_init
- References: <87ehe638ww dot fsf at fleche dot redhat dot com>
The checker pointed out some missing decrefs in cmdpy_init.
This patch adds them.
* python/py-cmd.c (cmdpy_init): Decref 'ds_obj'.
---
gdb/python/py-cmd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index ca9e415..6516e1f 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -499,9 +499,12 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
{
xfree (cmd_name);
xfree (pfx_name);
+ Py_DECREF (ds_obj);
return -1;
}
}
+
+ Py_XDECREF (ds_obj);
}
if (! docstring)
docstring = xstrdup (_("This command is not documented."));
--
1.8.1.4