Skip to content

Commit c794b64

Browse files
vstinnerned-deily
authored andcommitted
bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)
Free also co_extra->ce_extras, not only co_extra. (cherry picked from commit 23e7944) (cherry picked from commit 26daad4)
1 parent b6012f9 commit c794b64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/codeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ code_dealloc(PyCodeObject *co)
422422
}
423423
}
424424

425-
PyMem_FREE(co->co_extra);
425+
PyMem_Free(co_extra->ce_extras);
426+
PyMem_Free(co_extra);
426427
}
427428

428429
Py_XDECREF(co->co_code);

0 commit comments

Comments
 (0)