From 16581c86148dbd599fd4c5ad2146f00499434c4b Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Wed, 19 May 2004 14:39:08 +0000 Subject: [PATCH] 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 --- Modules/mmapmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 6cb47171b6..e1a2f4238b 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -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; -- 2.50.1