[PATCH 28/28] fix refcount bug in search_pp_list

Tom Tromey
2013-04-19T14:44:12Z

The checker noticed a missing decref in search_pp_list.

* python/py-prettyprint.c (search_pp_list): Decref 'attr'.
---
gdb/python/py-prettyprint.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index c337334..2d2af59 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -69,6 +69,7 @@ search_pp_list (PyObject *list, PyObject *value)
if (!attr)
return NULL;
cmp = PyObject_IsTrue (attr);
+ Py_DECREF (attr);
if (cmp == -1)
return NULL;

--
1.8.1.4