summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2004-05-19 14:39:08 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2004-05-19 14:39:08 (GMT)
commit16581c86148dbd599fd4c5ad2146f00499434c4b (patch)
treedea9e8070981a5d7e3fbe57e8d92f2105e8fe85e /Modules
parent354433a59dd1701985ec8463ced25a967cade3c1 (diff)
downloadcpython-16581c86148dbd599fd4c5ad2146f00499434c4b.zip
cpython-16581c86148dbd599fd4c5ad2146f00499434c4b.tar.gz
cpython-16581c86148dbd599fd4c5ad2146f00499434c4b.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 6cb4717..e1a2f42 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;