Set data pointer to NULL after an error; this keeps the mmap_dealloc() function from trying to do msync(-1);munmap(-1).

2.3 bugfix candidate, but this bug isn't critical enough that the fix has to go into 2.3.4
This commit is contained in:
Andrew M. Kuchling 2004-05-19 14:39:08 +00:00
parent 354433a59d
commit 16581c8614

View file

@ -912,6 +912,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
prot, flags,
fd, 0);
if (m_obj->data == (char *)-1) {
m_obj->data = NULL;
Py_DECREF(m_obj);
PyErr_SetFromErrno(mmap_module_error);
return NULL;