From: Dong-hee Na Date: Thu, 7 Apr 2022 23:27:00 +0000 (+0900) Subject: bpo-47250: Fix refleak from object.__getstate__() (GH-32403) X-Git-Tag: v3.11.0b1~421 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2d78baed385c349d756e96d8f0def0268fa9c4f;p=thirdparty%2FPython%2Fcpython.git bpo-47250: Fix refleak from object.__getstate__() (GH-32403) Co-authored-by: Brandt Bucher --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 64c4bbb5a932..f529e1813402 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5030,7 +5030,6 @@ object_getstate_default(PyObject *obj, int required) name = PyList_GET_ITEM(slotnames, i); Py_INCREF(name); - value = PyObject_GetAttr(obj, name); if (_PyObject_LookupAttr(obj, name, &value) < 0) { Py_DECREF(name); goto error;