Issue #21951: Fix AsObj() of the _tkinter module: raise MemoryError on memory
allocation failure
This commit is contained in:
parent
53c87d1be2
commit
60a64d6812
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user