This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 10/28] add decref to cmdpy_init


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]