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 19/28] add missing decref in py-param.c


The checker found a missing decref in compute_enum_values.

	* python/py-param.c (compute_enum_values): Decref 'item'.
---
 gdb/python/py-param.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 2cc17b6..fbd9a77 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -611,12 +611,14 @@ compute_enum_values (parmpy_object *self, PyObject *enum_values)
 	}
       if (! gdbpy_is_string (item))
 	{
+	  Py_DECREF (item);
 	  do_cleanups (back_to);
 	  PyErr_SetString (PyExc_RuntimeError, 
 			   _("The enumeration item not a string."));
 	  return 0;
 	}
       self->enumeration[i] = python_string_to_host_string (item);
+      Py_DECREF (item);
       if (self->enumeration[i] == NULL)
 	{
 	  do_cleanups (back_to);
-- 
1.8.1.4



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