diff options
author | Jesus Cea <jcea@jcea.es> | 2012-09-10 20:57:34 (GMT) |
---|---|---|
committer | Jesus Cea <jcea@jcea.es> | 2012-09-10 20:57:34 (GMT) |
commit | 8e03b4cae0cf37aac52827523fb3cf56894ffdf9 (patch) | |
tree | 0aaf5847664f4642d27bdbae6463f2564b74120e /Modules | |
parent | 20f0ea1f610842c98bbfcf653f4414b88f767083 (diff) | |
download | cpython-8e03b4cae0cf37aac52827523fb3cf56894ffdf9.zip cpython-8e03b4cae0cf37aac52827523fb3cf56894ffdf9.tar.gz cpython-8e03b4cae0cf37aac52827523fb3cf56894ffdf9.tar.bz2 |
#15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/mmapmodule.c | 1 |
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) { |