Add more missing PyErr_NoMemory() after failled memory allocs
This commit is contained in:
parent
42f08ac1e3
commit
ec74f2fda7
|
@ -2050,7 +2050,7 @@ Tkapp_CreateCommand(PyObject *_self, PyObject *args)
|
|||
|
||||
data = PyMem_NEW(PythonCmd_ClientData, 1);
|
||||
if (!data)
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
Py_XINCREF(self);
|
||||
Py_XINCREF(func);
|
||||
data->self = _self;
|
||||
|
|
|
@ -2251,7 +2251,7 @@ posix_execv(PyObject *self, PyObject *args)
|
|||
argvlist = PyMem_NEW(char *, argc+1);
|
||||
if (argvlist == NULL) {
|
||||
PyMem_Free(path);
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (!PyArg_Parse((*getitem)(argv, i), "et",
|
||||
|
@ -2480,7 +2480,7 @@ posix_spawnv(PyObject *self, PyObject *args)
|
|||
argvlist = PyMem_NEW(char *, argc+1);
|
||||
if (argvlist == NULL) {
|
||||
PyMem_Free(path);
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (!PyArg_Parse((*getitem)(argv, i), "et",
|
||||
|
|
|
@ -6661,7 +6661,7 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
if (pnew->str == NULL) {
|
||||
_Py_ForgetReference((PyObject *)pnew);
|
||||
PyObject_Del(pnew);
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
Py_UNICODE_COPY(pnew->str, tmp->str, n+1);
|
||||
pnew->length = n;
|
||||
|
|
Loading…
Reference in New Issue