]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Set data pointer to NULL after an error; this keeps the mmap_dealloc() function
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 1 Jun 2004 13:00:16 +0000 (13:00 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 1 Jun 2004 13:00:16 +0000 (13:00 +0000)
from trying to do msync(-1);munmap(-1).

Modules/mmapmodule.c

index a61a37a10c664db3e9bbeed3dde5abcb8a20c4c2..b6eba0355fe2bcc4e4cd7fe441ef3bc24d2bcb75 100644 (file)
@@ -917,6 +917,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;