[PATCH 10/28] add decref to cmdpy_init

Tom Tromey tromey@redhat.com
Fri Apr 19 14:41:00 GMT 2013


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




More information about the Gdb-patches mailing list