From: JINMEI Tatuya Date: Tue, 31 Jan 2012 00:00:22 +0000 (-0800) Subject: [1574b] made sure Py_True/False gained refcount on return. X-Git-Tag: trac2351_base~268^2~5^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3602cd9d13d6add722665b25bea2ed5ba56fa28d;p=thirdparty%2Fkea.git [1574b] made sure Py_True/False gained refcount on return. --- diff --git a/src/lib/dns/python/nsec3hash_python.cc b/src/lib/dns/python/nsec3hash_python.cc index 91eb448636..68c9ffaa2f 100644 --- a/src/lib/dns/python/nsec3hash_python.cc +++ b/src/lib/dns/python/nsec3hash_python.cc @@ -134,7 +134,9 @@ NSEC3Hash_match(PyObject* po_self, PyObject* args) { const bool matched = self->cppobj->match( dynamic_cast( PyRdata_ToRdata(po_rdata))); - return (matched ? Py_True : Py_False); + PyObject* ret = matched ? Py_True : Py_False; + Py_INCREF(ret); + return (ret); } } catch (const exception& ex) { const string ex_what = "Unexpected failure in NSEC3Hash.match: " +