Skip to content

Commit 67bd81b

Browse files
committed
MERGE: python#15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
2 parents 4886d5b + e8db356 commit 67bd81b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Modules/mmapmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
13671367
if (size == 0) {
13681368
PyErr_SetString(PyExc_ValueError,
13691369
"cannot mmap an empty file");
1370+
Py_DECREF(m_obj);
13701371
return NULL;
13711372
}
13721373
if (offset >= size) {

0 commit comments

Comments
 (0)