]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93728: fix memory leak in deepfrozen code objects (GH-93729)
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sun, 12 Jun 2022 14:42:18 +0000 (20:12 +0530)
committerGitHub <noreply@github.com>
Sun, 12 Jun 2022 14:42:18 +0000 (22:42 +0800)
Objects/codeobject.c

index dc6dec1b2a549bc6f15d1f213a600fdbf21ebf50..2a2f132a6ef6249c716f8d96eb672e46abd16c89 100644 (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);