Fix SF bug #1402308, segfault when using mmap(-1, ...)

This didn't crash on Linux, but valgrind complained.
I'm not sure if this test is valid on Windows.

Will backport.
This commit is contained in:
Neal Norwitz 2006-01-11 08:54:45 +00:00
parent ae1df41127
commit 3b4fff8079
5 changed files with 13 additions and 0 deletions

View file

@ -918,6 +918,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
#endif
m_obj = PyObject_New (mmap_object, &mmap_object_type);
if (m_obj == NULL) {return NULL;}
m_obj->data = NULL;
m_obj->size = (size_t) map_size;
m_obj->pos = (size_t) 0;
m_obj->fd = dup(fd);