* python/py-param.c (compute_enum_values): Decref 'item'.

This commit is contained in:
Tom Tromey 2013-05-20 20:30:24 +00:00
parent 0646da15da
commit fcb49fc817
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
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.

View File

@ -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);