Skip to content

Commit 015f253

Browse files
committed
gh-146102: Catch PyErr_NewException() failure in zlib
1 parent 72e7edd commit 015f253

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Modules/zlibmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,9 @@ zlib_exec(PyObject *mod)
22092209
}
22102210

22112211
state->ZlibError = PyErr_NewException("zlib.error", NULL, NULL);
2212+
if (state->ZlibError == NULL) {
2213+
return -1;
2214+
}
22122215
if (PyModule_AddObjectRef(mod, "error", state->ZlibError) < 0) {
22132216
return -1;
22142217
}

0 commit comments

Comments
 (0)