* python/py-param.c (compute_enum_values): Decref 'item'.
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:30:24 +0000 (20:30 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:30:24 +0000 (20:30 +0000)
gdb/ChangeLog
gdb/python/py-param.c

index 19707154dfec1319a7c64bf2da525f87c8d52a02..f394f8707249faf9d8a637ed0a422118a70cde85 100644 (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.
index 2cc17b6a71d8c213750fdb7287f48363691c6bb5..fbd9a7706f4882a8adc2c5e9ecb303bc45c9c128 100644 (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);