summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-14 07:02:53 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-14 07:02:53 (GMT)
commit63fd4f44487feda3f5db0065ffe5fbb574d698a3 (patch)
tree1777fa42b4abf195e85e0c0535abe49a1f0b19c3 /Modules/mmapmodule.c
parentd901f75c552a6e47ab80064419c40aff9dda3468 (diff)
downloadcpython-63fd4f44487feda3f5db0065ffe5fbb574d698a3.zip
cpython-63fd4f44487feda3f5db0065ffe5fbb574d698a3.tar.gz
cpython-63fd4f44487feda3f5db0065ffe5fbb574d698a3.tar.bz2
Backport:
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.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index db24e46..9fd2ca4 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -914,6 +914,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);