diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-07-14 05:44:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 05:44:08 (GMT) |
commit | 94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b (patch) | |
tree | 9dcfe95b57534bb572b522a52e68cd7dcafb9ccd /Modules | |
parent | fe73509c5ba3844b45a2253967522531ab80c849 (diff) | |
download | cpython-94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b.zip cpython-94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b.tar.gz cpython-94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b.tar.bz2 |
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
if it is called with a sequence or set, but not list or tuple.
(cherry picked from commit f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index b7958ea..19853ce 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -3197,8 +3197,10 @@ _tkinter__flatten(PyObject *module, PyObject *item) context.size = 0; - if (!_flatten1(&context, item,0)) + if (!_flatten1(&context, item, 0)) { + Py_XDECREF(context.tuple); return NULL; + } if (_PyTuple_Resize(&context.tuple, context.size)) return NULL; |