diff options
author | Doug Evans <dje@google.com> | 2014-12-08 18:27:41 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-12-08 18:27:41 -0800 |
commit | d4d1e336f94fe40283d6c27b79723fd4bac3ed13 (patch) | |
tree | 84f89b8dd97f050b1bccde95ceb97c92e982be9c /gdb/python/py-objfile.c | |
parent | f505f9504cc1b9c48ddd9c65c4cd45d250fb4c0c (diff) | |
download | binutils-gdb-d4d1e336f94fe40283d6c27b79723fd4bac3ed13.tar.gz |
python/py-objfile.c (objfpy_get_owner): Increment refcount of result.
gdb/ChangeLog:
* python/py-objfile.c (objfpy_get_owner): Increment refcount of result.
Diffstat (limited to 'gdb/python/py-objfile.c')
-rw-r--r-- | gdb/python/py-objfile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c index 51cf47cfffd..d90928bb300 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -93,9 +93,13 @@ objfpy_get_owner (PyObject *self, void *closure) OBJFPY_REQUIRE_VALID (obj); owner = objfile->separate_debug_objfile_backlink; - if (owner != NULL) - return objfile_to_objfile_object (owner); + { + PyObject *result = objfile_to_objfile_object (owner); + + Py_XINCREF (result); + return result; + } Py_RETURN_NONE; } |