commit | 4cde4bdcc86cb08ee3847500a172cc24eba37ffe | [log] [tgz] |
---|---|---|
author | INADA Naoki <methane@users.noreply.github.com> | Mon Sep 04 12:31:41 2017 +0900 |
committer | GitHub <noreply@github.com> | Mon Sep 04 12:31:41 2017 +0900 |
tree | cfc4c00f39f0cc6e9fec1e9756cf81c059ff9d6a | |
parent | 990b2d043cdfaafc3378550f7d27259410a6b918 [diff] [blame] |
bpo-31095: Fix potential crash during GC (GH-3197) (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index 1335ae8..0ee4b80 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c
@@ -745,6 +745,7 @@ static void bytesio_dealloc(bytesio *self) { + /* bpo-31095: UnTrack is needed before calling any callbacks */ _PyObject_GC_UNTRACK(self); if (self->buf != NULL) { PyMem_Free(self->buf);