summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index cb11c8c74e..ec6b3dadc0 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1829,6 +1829,9 @@ PyMarshal_Init(void)
PyObject *mod = PyModule_Create(&marshalmodule);
if (mod == NULL)
return NULL;
- PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
+ if (PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION) < 0) {
+ Py_DECREF(mod);
+ return NULL;
+ }
return mod;
}