From: Victor Stinner Date: Wed, 28 Jun 2017 00:28:51 +0000 (+0200) Subject: bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456) X-Git-Tag: v3.6.3rc1~291 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26daad4ee14693381d84a5235709d22aed1c22ed;p=python 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) --- 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);