diff --git a/Objects/descrobject.c b/Objects/descrobject.c index e26f90224f68b7..72ac4703949262 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1802,8 +1802,8 @@ property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset, // See PropertySubclassTest.test_slots_docstring_copy_exception. int err = PyObject_SetAttr( (PyObject *)self, &_Py_ID(__doc__), prop_doc); - Py_DECREF(prop_doc); if (err < 0) { + Py_DECREF(prop_doc); // release our new reference. return -1; } }