summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/mmapmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 62d934c..03685ce 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -1391,6 +1391,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
if (size == 0) {
PyErr_SetString(PyExc_ValueError,
"cannot mmap an empty file");
+ Py_DECREF(m_obj);
return NULL;
}
if (offset >= size) {