summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-14 05:44:08 (GMT)
committerGitHub <noreply@github.com>2021-07-14 05:44:08 (GMT)
commit94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b (patch)
tree9dcfe95b57534bb572b522a52e68cd7dcafb9ccd /Modules
parentfe73509c5ba3844b45a2253967522531ab80c849 (diff)
downloadcpython-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.c4
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;