This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 26/28] fix refcount bug in typy_fields
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 19 Apr 2013 08:43:27 -0600
- Subject: [PATCH 26/28] fix refcount bug in typy_fields
- References: <87ehe638ww dot fsf at fleche dot redhat dot com>
The checker found a bug in typy_fields -- we leaked a reference in one
path.
* python/py-type.c (typy_fields): Unconditionally decref 'r'.
---
gdb/python/py-type.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 63629fe..337e307 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -379,10 +379,7 @@ typy_fields (PyObject *self, PyObject *args)
return NULL;
rl = Py_BuildValue ("[O]", r);
- if (rl == NULL)
- {
- Py_DECREF (r);
- }
+ Py_DECREF (r);
return rl;
}
--
1.8.1.4