From 8432bc4103216c10c1a2f18aaf445a61f6c4195e Mon Sep 17 00:00:00 2001 From: Phil Muldoon Date: Mon, 24 Oct 2011 11:39:50 +0000 Subject: 2011-10-24 Phil Muldoon PR python/13310 * python/py-param.c (call_doc_function): Correctly deference on function exit. --- gdb/ChangeLog | 7 +++++++ gdb/python/py-param.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6927bbd..cc266d4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-10-24 Phil Muldoon + + PR python/13310 + + * python/py-param.c (call_doc_function): Correctly deference on + function exit. + 2011-10-21 Joel Brobecker * ada-tasks.c (print_ada_task_info): Fix computation of diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index d68d8fb..fe31cd1 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -331,6 +331,7 @@ call_doc_function (PyObject *obj, PyObject *method, PyObject *arg) if (gdbpy_is_string (result)) { data = python_string_to_host_string (result); + Py_DECREF (result); if (! data) return NULL; } @@ -338,6 +339,7 @@ call_doc_function (PyObject *obj, PyObject *method, PyObject *arg) { PyErr_SetString (PyExc_RuntimeError, _("Parameter must return a string value.")); + Py_DECREF (result); return NULL; } -- cgit v1.1