From 0a7c3ff046f7a630d5adc09d798c62f38e2c4cd7 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Tue, 1 Jun 2004 13:00:16 +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). --- Modules/mmapmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index a61a37a10c66..b6eba0355fe2 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -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; -- 2.47.3