diff options
Diffstat (limited to 'Modules/_winapi.c')
-rw-r--r-- | Modules/_winapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c index a81ccaf..00a26d51 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -723,9 +723,13 @@ getenvironment(PyObject* environment) } keys = PyMapping_Keys(environment); + if (!keys) { + return NULL; + } values = PyMapping_Values(environment); - if (!keys || !values) + if (!values) { goto error; + } envsize = PySequence_Fast_GET_SIZE(keys); if (PySequence_Fast_GET_SIZE(values) != envsize) { |