summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules/_winapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Modules/_winapi.c')
-rw-r--r--contrib/tools/python3/Modules/_winapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/tools/python3/Modules/_winapi.c b/contrib/tools/python3/Modules/_winapi.c
index d51586e6025..4d486400a09 100644
--- a/contrib/tools/python3/Modules/_winapi.c
+++ b/contrib/tools/python3/Modules/_winapi.c
@@ -1184,8 +1184,10 @@ gethandlelist(PyObject *mapping, const char *name, Py_ssize_t *size)
}
ret = PyMem_Malloc(*size);
- if (ret == NULL)
+ if (ret == NULL) {
+ PyErr_NoMemory();
goto cleanup;
+ }
for (i = 0; i < PySequence_Fast_GET_SIZE(value_fast); i++) {
ret[i] = PYNUM_TO_HANDLE(PySequence_Fast_GET_ITEM(value_fast, i));
@@ -1268,6 +1270,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
attribute_list->attribute_list = PyMem_Malloc(attribute_list_size);
if (attribute_list->attribute_list == NULL) {
ret = -1;
+ PyErr_NoMemory();
goto cleanup;
}