summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-28 00:12:00 (GMT)
committerGitHub <noreply@github.com>2017-06-28 00:12:00 (GMT)
commit23e7944eba1968bb8432fdc4cc96d4fdd2c1a230 (patch)
treef3fbfa728ca5eb757ba0daa2936c4dc6109efd37 /Objects/codeobject.c
parent36fc896740319d2c03aa2054a90a999c162517ef (diff)
downloadcpython-23e7944eba1968bb8432fdc4cc96d4fdd2c1a230.zip
cpython-23e7944eba1968bb8432fdc4cc96d4fdd2c1a230.tar.gz
cpython-23e7944eba1968bb8432fdc4cc96d4fdd2c1a230.tar.bz2
bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455)
Free also co_extra->ce_extras, not only co_extra.
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index eb860c8..1979606 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -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);