[pypy-commit] pypy cpyext-ext: fix ref leak in test

mattip pypy.commits at gmail.com
Sat Jan 16 15:19:16 EST 2016


Author: mattip <matti.picus at gmail.com>
Branch: cpyext-ext
Changeset: r81824:e44851036099
Date: 2016-01-16 19:05 +0200
http://bitbucket.org/pypy/pypy/changeset/e44851036099/

Log:	fix ref leak in test

diff --git a/pypy/module/cpyext/test/foo.c b/pypy/module/cpyext/test/foo.c
--- a/pypy/module/cpyext/test/foo.c
+++ b/pypy/module/cpyext/test/foo.c
@@ -695,7 +695,7 @@
         _CMPDOC(MemberDescr, new->d_member->doc, new->d_member->name);
     }
     else if (_TESTDOC2(GetSetDescr)) {
-        //_CMPDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name);
+        _CMPDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name);
     }
     else if (_TESTDOC2(MethodDescr)) {
         _CMPDOC(MethodDescr, new->d_method->ml_doc, new->d_method->ml_name);
@@ -706,6 +706,7 @@
         doc_attr = PyObject_GetAttrString(obj, "__doc__");
         if (doc_attr == NULL || doc_attr == Py_None) {
             PyErr_Format(PyExc_RuntimeError, "object %s", msg);
+            Py_XDECREF(doc_attr);
             return NULL;
         }
 


More information about the pypy-commit mailing list