diff options
Diffstat (limited to 'Doc/includes/custom2.c')
| -rw-r--r-- | Doc/includes/custom2.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/includes/custom2.c b/Doc/includes/custom2.c index 6477a19daf..5bacab7a2a 100644 --- a/Doc/includes/custom2.c +++ b/Doc/includes/custom2.c @@ -128,6 +128,11 @@ PyInit_custom2(void) return NULL; Py_INCREF(&CustomType); - PyModule_AddObject(m, "Custom", (PyObject *) &CustomType); + if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) { + Py_DECREF(&CustomType); + Py_DECREF(m); + return NULL; + } + return m; } |
