PR python/13308
PR python/13309
* python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference
leak.
* python/py-inferior.c (gdbpy_inferiors): Fix List reference
leak. Delete unused variables.
+2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
+
+ PR python/13308
+ PR python/13309
+
+ * python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference
+ leak.
+ * python/py-inferior.c (gdbpy_inferiors): Fix List reference
+ leak. Delete unused variables.
+
2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
PR python/12656
PyObject *
gdbpy_breakpoints (PyObject *self, PyObject *args)
{
- PyObject *list;
+ PyObject *list, *tuple;
if (bppy_live == 0)
Py_RETURN_NONE;
return NULL;
}
- return PyList_AsTuple (list);
+ tuple = PyList_AsTuple (list);
+ Py_DECREF (list);
+
+ return tuple;
}
/* Call the "stop" method (if implemented) in the breakpoint
PyObject *
gdbpy_inferiors (PyObject *unused, PyObject *unused2)
{
- int i = 0;
- PyObject *list, *inferior;
- struct inferior *inf;
+ PyObject *list, *tuple;
list = PyList_New (0);
if (!list)
return NULL;
}
- return PyList_AsTuple (list);
+ tuple = PyList_AsTuple (list);
+ Py_DECREF (list);
+
+ return tuple;
}
/* Membuf and memory manipulation. */