aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 79b5d24d1cf..d2a77890072 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1020,11 +1020,11 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
return NULL;
for (size_t i = 0; i < sals.size (); ++i)
{
- PyObject *obj = symtab_and_line_to_sal_object (sals[i]);
- if (obj == NULL)
- return NULL;
+ gdbpy_ref<> obj = symtab_and_line_to_sal_object (sals[i]);
+ if (obj == nullptr)
+ return nullptr;
- PyTuple_SetItem (result.get (), i, obj);
+ PyTuple_SetItem (result.get (), i, obj.release ());
}
}
else