bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456) · python/cpython@c794b64 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit c794b64

vstinnerned-deily

authored and

committed

Free also co_extra->ce_extras, not only co_extra. (cherry picked from commit 23e7944) (cherry picked from commit 26daad4)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -422,7 +422,8 @@ code_dealloc(PyCodeObject *co)
422 422 }
423 423 }
424 424
425 - PyMem_FREE(co->co_extra);
425 + PyMem_Free(co_extra->ce_extras);
426 + PyMem_Free(co_extra);
426 427 }
427 428
428 429 Py_XDECREF(co->co_code);