* python/py-cmd.c (cmdpy_init): Decref 'ds_obj'.
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:20:48 +0000 (20:20 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:20:48 +0000 (20:20 +0000)
gdb/ChangeLog
gdb/python/py-cmd.c

index 949ae19..64bac86 100644 (file)
@@ -1,5 +1,9 @@
 2013-05-20  Tom Tromey  <tromey@redhat.com>
 
+       * python/py-cmd.c (cmdpy_init): Decref 'ds_obj'.
+
+2013-05-20  Tom Tromey  <tromey@redhat.com>
+
        * python/py-event.h (gdbpy_initialize_event_generic): Use
        CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
        * python/py-evts.c (add_new_registry): Use
index ca9e415..6516e1f 100644 (file)
@@ -499,9 +499,12 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
            {
              xfree (cmd_name);
              xfree (pfx_name);
+             Py_DECREF (ds_obj);
              return -1;
            }
        }
+
+      Py_XDECREF (ds_obj);
     }
   if (! docstring)
     docstring = xstrdup (_("This command is not documented."));