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