gh-93728: fix memory leak in deepfrozen code objects (GH-93729)

This commit is contained in:
Kumar Aditya 2022-06-12 20:12:18 +05:30 committed by GitHub
parent 3473817106
commit 8f728e5baa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2092,6 +2092,7 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
deopt_code(_PyCode_CODE(co), Py_SIZE(co));
co->co_warmup = QUICKENING_INITIAL_WARMUP_VALUE;
PyMem_Free(co->co_extra);
Py_CLEAR(co->_co_code);
co->co_extra = NULL;
if (co->co_weakreflist != NULL) {
PyObject_ClearWeakRefs((PyObject *)co);