Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb53869

Browse files
committed
gh-103879: Fix refleak in super specialization
1 parent 1c0a9c5 commit fb53869

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

+2
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,10 @@ _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *
544544
write_u32(cache->self_type_version, Py_TYPE(self)->tp_version_tag);
545545
write_obj(cache->method, res); // borrowed
546546
instr->op.code = LOAD_SUPER_ATTR_METHOD;
547+
Py_DECREF(res);
547548
goto success;
548549
}
550+
Py_DECREF(res);
549551
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_NOT_METHOD);
550552

551553
fail:

0 commit comments

Comments
 (0)