diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2011-10-20 13:34:17 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2011-10-20 13:34:17 +0000 |
commit | 27ca1a5b081f313daa1d06190b12abbe645da583 (patch) | |
tree | 7fb46b0ea8547d61e3d993ff3e23c030480dca30 /gdb/python/py-inferior.c | |
parent | 4a89cbfcf55d59f3226bd06b6439d4b2833ea736 (diff) | |
download | gdb-27ca1a5b081f313daa1d06190b12abbe645da583.zip gdb-27ca1a5b081f313daa1d06190b12abbe645da583.tar.gz gdb-27ca1a5b081f313daa1d06190b12abbe645da583.tar.bz2 |
2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
PR python/13308
PR python/13309
* python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference
leak.
* python/py-inferior.c (gdbpy_inferiors): Fix List reference
leak. Delete unused variables.
Diffstat (limited to 'gdb/python/py-inferior.c')
-rw-r--r-- | gdb/python/py-inferior.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index afc3eb0..d6086dc 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -377,9 +377,7 @@ build_inferior_list (struct inferior *inf, void *arg) PyObject * gdbpy_inferiors (PyObject *unused, PyObject *unused2) { - int i = 0; - PyObject *list, *inferior; - struct inferior *inf; + PyObject *list, *tuple; list = PyList_New (0); if (!list) @@ -391,7 +389,10 @@ gdbpy_inferiors (PyObject *unused, PyObject *unused2) return NULL; } - return PyList_AsTuple (list); + tuple = PyList_AsTuple (list); + Py_DECREF (list); + + return tuple; } /* Membuf and memory manipulation. */ |