Skip to content

Commit

Permalink
DECREF before return, not always.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Jun 5, 2023
1 parent 517bd0d commit 0307832
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0307832

Please sign in to comment.