]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-47250: Fix refleak from object.__getstate__() (GH-32403)
authorDong-hee Na <donghee.na@python.org>
Thu, 7 Apr 2022 23:27:00 +0000 (08:27 +0900)
committerGitHub <noreply@github.com>
Thu, 7 Apr 2022 23:27:00 +0000 (08:27 +0900)
Co-authored-by: Brandt Bucher <brandt@python.org>
Objects/typeobject.c

index 64c4bbb5a932607e2579111d03e7b93286813e6c..f529e18134025b01e8129a647b2c2044bbf187eb 100644 (file)
@@ -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;