]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 28 Jun 2017 00:12:00 +0000 (02:12 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2017 00:12:00 +0000 (02:12 +0200)
Free also co_extra->ce_extras, not only co_extra.

Objects/codeobject.c

index eb860c814b8bd120f1b2fdc497fe77d940e728fb..1979606910602303d43d6d070f636df148956674 100644 (file)
@@ -427,7 +427,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);