Commit 60a64d68 authored by Victor Stinner's avatar Victor Stinner

Issue #21951: Fix AsObj() of the _tkinter module: raise MemoryError on memory

allocation failure
parent 53c87d1b
......@@ -913,8 +913,10 @@ AsObj(PyObject *value)
return NULL;
}
argv = (Tcl_Obj **) ckalloc(((size_t)size) * sizeof(Tcl_Obj *));
if(!argv)
return 0;
if(!argv) {
PyErr_NoMemory();
return NULL;
}
for (i = 0; i < size; i++)
argv[i] = AsObj(PySequence_Fast_GET_ITEM(value,i));
result = Tcl_NewListObj(size, argv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment