summaryrefslogtreecommitdiffstats
path: root/Doc/includes/custom.c
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/includes/custom.c')
-rw-r--r--Doc/includes/custom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/includes/custom.c b/Doc/includes/custom.c
index 13d16f5..bda32e2 100644
--- a/Doc/includes/custom.c
+++ b/Doc/includes/custom.c
@@ -35,6 +35,11 @@ PyInit_custom(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;
}