diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2017-09-26 21:24:16 (GMT) |
---|---|---|
committer | larryhastings <larry@hastings.org> | 2017-09-26 21:24:16 (GMT) |
commit | 0fcc03367b31f44c1e1b8d3d2dd940ef1e744326 (patch) | |
tree | e889a3b7de22ace9191e6b9ffd45093e897a3384 /Modules/_struct.c | |
parent | 44c1b62939a6192776dc9d093546154044cb2ecb (diff) | |
download | cpython-0fcc03367b31f44c1e1b8d3d2dd940ef1e744326.zip cpython-0fcc03367b31f44c1e1b8d3d2dd940ef1e744326.tar.gz cpython-0fcc03367b31f44c1e1b8d3d2dd940ef1e744326.tar.bz2 |
bpo-31095: fix potential crash during GC (GH-2974) (#3196)
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r-- | Modules/_struct.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 2273129..5817b5e 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1581,6 +1581,8 @@ typedef struct { static void unpackiter_dealloc(unpackiterobject *self) { + /* bpo-31095: UnTrack is needed before calling any callbacks */ + PyObject_GC_UnTrack(self); Py_XDECREF(self->so); PyBuffer_Release(&self->buf); PyObject_GC_Del(self); |