diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-11-02 15:13:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 15:13:07 (GMT) |
commit | 6d683d85252df3c8dba7c33f7db87cdc1bcb0bf0 (patch) | |
tree | 0f962cf408c26f42da79cd49338c71409467551d /Python/symtable.c | |
parent | c76db37c0d23174cbffd6fa978d39693890ef020 (diff) | |
download | cpython-6d683d85252df3c8dba7c33f7db87cdc1bcb0bf0.zip cpython-6d683d85252df3c8dba7c33f7db87cdc1bcb0bf0.tar.gz cpython-6d683d85252df3c8dba7c33f7db87cdc1bcb0bf0.tar.bz2 |
gh-87092: do not allocate PyFutureFeatures dynamically (GH-98913)
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 342f5a0..ea195bc 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -2144,14 +2144,13 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, _PyArena_Free(arena); return NULL; } - PyFutureFeatures *future = _PyFuture_FromAST(mod, filename); - if (future == NULL) { + PyFutureFeatures future; + if (!_PyFuture_FromAST(mod, filename, &future)) { _PyArena_Free(arena); return NULL; } - future->ff_features |= flags->cf_flags; - st = _PySymtable_Build(mod, filename, future); - PyObject_Free((void *)future); + future.ff_features |= flags->cf_flags; + st = _PySymtable_Build(mod, filename, &future); _PyArena_Free(arena); return st; } |