mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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
This commit is contained in:
parent
354433a59d
commit
16581c8614
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue