mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
if it is called with a sequence or set, but not list or tuple.
This commit is contained in:
parent
81989058de
commit
f572cbf1fa
3 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue