Browse Source

[1574b] made sure Py_True/False gained refcount on return.

JINMEI Tatuya 13 years ago
parent
commit
3602cd9d13
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/dns/python/nsec3hash_python.cc

+ 3 - 1
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<const generic::NSEC3&>(
                     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: " +