Skip to content

Commit 3c4a208

Browse files
Handle NULL return value from PyErr_NewException (#22)
1 parent 1a08330 commit 3c4a208

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

iconvmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ PyInit_iconv(void)
189189
/* Add some symbolic constants to the module */
190190
d = PyModule_GetDict(m);
191191
error = PyErr_NewException("iconv.error", PyExc_ValueError, NULL);
192+
if (error == NULL) {
193+
return NULL;
194+
}
192195
PyDict_SetItemString(d, "error", error);
193196

194197
return m;

0 commit comments

Comments
 (0)