summaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:30:23 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:30:23 +0000
commite0ede36274a194c07ed4407f4471849e3bda9db8 (patch)
tree3c28f3b955c07d341b44890e439a9f0f87e3a8ef /gdb/python
parent27ace36109505b3b255e60778b487decce10e92e (diff)
downloadgdb-e0ede36274a194c07ed4407f4471849e3bda9db8.tar.gz
* python/py-param.c (compute_enum_values): Decref 'item'.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-param.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 2cc17b6a71d..fbd9a7706f4 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);