Skip to content

Commit 6c4124d

Browse files
gh-103879: Fix refleak in super specialization (#103882)
1 parent 1c0a9c5 commit 6c4124d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy