summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-01-10 20:52:16 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-01-10 20:52:16 (GMT)
commite604c02a803f075efecb318f5fb584faf7bf12c4 (patch)
treeb6565e57f8c5610323528b299feb4bd379e8e9b9 /Modules
parente7a161e60ceb5ca24752404683802f49afe18e8c (diff)
downloadcpython-e604c02a803f075efecb318f5fb584faf7bf12c4.zip
cpython-e604c02a803f075efecb318f5fb584faf7bf12c4.tar.gz
cpython-e604c02a803f075efecb318f5fb584faf7bf12c4.tar.bz2
SF #665913, Fix mmap module core dump with unix
Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump. Will backport.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index cff3c14..f1df4dc 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -141,8 +141,10 @@ mmap_close_method(mmap_object *self, PyObject *args)
#endif /* MS_WINDOWS */
#ifdef UNIX
- munmap(self->data, self->size);
- self->data = NULL;
+ if (self->data != NULL) {
+ munmap(self->data, self->size);
+ self->data = NULL;
+ }
#endif
Py_INCREF (Py_None);