aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/python/py-param.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1970715..f394f87 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2013-05-20 Tom Tromey <tromey@redhat.com>
+ * python/py-param.c (compute_enum_values): Decref 'item'.
+
+2013-05-20 Tom Tromey <tromey@redhat.com>
+
* mi/mi-main.c: Include python-internal.h.
(mi_cmd_list_features): Check gdb_python_initialized.
* python/py-inferior.c (python_on_normal_stop, python_on_resume)
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);