aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 87265e2..daceb99 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -697,7 +697,7 @@ build_bp_list (struct breakpoint *b, void *arg)
PyObject *
gdbpy_breakpoints (PyObject *self, PyObject *args)
{
- PyObject *list;
+ PyObject *list, *tuple;
if (bppy_live == 0)
Py_RETURN_NONE;
@@ -715,7 +715,10 @@ gdbpy_breakpoints (PyObject *self, PyObject *args)
return NULL;
}
- return PyList_AsTuple (list);
+ tuple = PyList_AsTuple (list);
+ Py_DECREF (list);
+
+ return tuple;
}
/* Call the "stop" method (if implemented) in the breakpoint