From 26daad4ee14693381d84a5235709d22aed1c22ed Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 28 Jun 2017 02:28:51 +0200 Subject: [PATCH] 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 23e7944eba1968bb8432fdc4cc96d4fdd2c1a230) --- Objects/codeobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index d38f185ba3..6de697ae3f 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -422,7 +422,8 @@ code_dealloc(PyCodeObject *co) } } - PyMem_FREE(co->co_extra); + PyMem_Free(co_extra->ce_extras); + PyMem_Free(co_extra); } Py_XDECREF(co->co_code); -- 2.40.0