Skip to content

Commit 42352a4

Browse files
committed
check result of Py_BuildValue
1 parent af115c1 commit 42352a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_winapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,9 @@ static PyMethodDef winapi_functions[] = {
19131913
#define WINAPI_CONSTANT(fmt, con) \
19141914
do { \
19151915
PyObject *value = Py_BuildValue(fmt, con); \
1916+
if (value == NULL) { \
1917+
return -1; \
1918+
} \
19161919
if (PyDict_SetItemString(d, #con, value) < 0) { \
19171920
Py_DECREF(value); \
19181921
return -1; \

0 commit comments

Comments
 (0)