This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFC: another Python refcounting fix
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 20 May 2013 14:46:58 -0600
- Subject: RFC: another Python refcounting fix
I had a couple more refcounting fixes on my Python checker branch.
Here's the first one. finish_python_initialization does not decref
'pythondir' along all the exit paths.
Built and regtested on x86-64 Fedora 18.
Tom
* python/python.c (finish_python_initialization): Decref
'pythondir' on failure path as well.
---
gdb/python/python.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 690534f..e5705a8 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1770,10 +1770,9 @@ finish_python_initialization (void)
goto fail;
err = PyList_Insert (sys_path, 0, pythondir);
+ Py_DECREF (pythondir);
if (err)
goto fail;
-
- Py_DECREF (pythondir);
}
else
goto fail;
--
1.8.1.4