From e8db356cf1084105a97db9457a2374209868005b Mon Sep 17 00:00:00 2001 From: Jesus Cea Date: Mon, 10 Sep 2012 22:58:07 +0200 Subject: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2) --- Modules/mmapmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index b993fdf..33c143e 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -1345,6 +1345,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) { -- cgit v0.12