summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-04-26 08:50:19 -0700
committerGitHub <noreply@github.com>2023-04-26 08:50:19 -0700
commit6c4124d11ab731f3774e3454ded33df089bd317e (patch)
tree70f61118660dd0227877746ffae39e67fc02b765 /Python
parent1c0a9c5a1c84bc334f2bde9d45676f19d9632823 (diff)
downloadcpython-git-6c4124d11ab731f3774e3454ded33df089bd317e.tar.gz
gh-103879: Fix refleak in super specialization (#103882)
Diffstat (limited to 'Python')
-rw-r--r--Python/specialize.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 9230087a78..33a3c4561c 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -544,8 +544,10 @@ _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *
write_u32(cache->self_type_version, Py_TYPE(self)->tp_version_tag);
write_obj(cache->method, res); // borrowed
instr->op.code = LOAD_SUPER_ATTR_METHOD;
+ Py_DECREF(res);
goto success;
}
+ Py_DECREF(res);
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_NOT_METHOD);
fail: