summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2012-09-10 20:58:35 (GMT)
committerJesus Cea <jcea@jcea.es>2012-09-10 20:58:35 (GMT)
commit67bd81b8671e98149dcb3207e774e7abfd6159f2 (patch)
tree5e63915e24e3b472e0cba04933e97e5b9b98546f
parent4886d5b3385800cb302336b1ec3153833345226e (diff)
parente8db356cf1084105a97db9457a2374209868005b (diff)
downloadcpython-67bd81b8671e98149dcb3207e774e7abfd6159f2.zip
cpython-67bd81b8671e98149dcb3207e774e7abfd6159f2.tar.gz
cpython-67bd81b8671e98149dcb3207e774e7abfd6159f2.tar.bz2
MERGE: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
-rw-r--r--Modules/mmapmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 3e20934..d650eae 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -1367,6 +1367,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) {