Commit 16581c86 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Set data pointer to NULL after an error; this keeps the mmap_dealloc()...

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
parent 354433a5
...@@ -912,6 +912,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) ...@@ -912,6 +912,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
prot, flags, prot, flags,
fd, 0); fd, 0);
if (m_obj->data == (char *)-1) { if (m_obj->data == (char *)-1) {
m_obj->data = NULL;
Py_DECREF(m_obj); Py_DECREF(m_obj);
PyErr_SetFromErrno(mmap_module_error); PyErr_SetFromErrno(mmap_module_error);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment