summaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index f541a987894..66b6631f93a 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1293,9 +1293,9 @@ gdbpy_progspaces (PyObject *unused1, PyObject *unused2)
ALL_PSPACES (ps)
{
- PyObject *item = pspace_to_pspace_object (ps);
+ gdbpy_ref<> item = pspace_to_pspace_object (ps);
- if (!item || PyList_Append (list.get (), item) == -1)
+ if (item == NULL || PyList_Append (list.get (), item.get ()) == -1)
return NULL;
}