From: Andrew M. Kuchling Date: Tue, 1 Jun 2004 13:00:16 +0000 (+0000) Subject: Set data pointer to NULL after an error; this keeps the mmap_dealloc() function X-Git-Tag: v2.3.5c1~240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a7c3ff046f7a630d5adc09d798c62f38e2c4cd7;p=thirdparty%2FPython%2Fcpython.git Set data pointer to NULL after an error; this keeps the mmap_dealloc() function from trying to do msync(-1);munmap(-1). --- 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;