From: Phil Muldoon Date: Mon, 24 Oct 2011 11:39:50 +0000 (+0000) Subject: 2011-10-24 Phil Muldoon X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8432bc4103216c10c1a2f18aaf445a61f6c4195e;p=binutils-gdb.git 2011-10-24 Phil Muldoon PR python/13310 * python/py-param.c (call_doc_function): Correctly deference on function exit. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6927bbdb125..cc266d4d407 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 d68d8fb9fe8..fe31cd17ff1 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; }