diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-01-10 20:52:16 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-01-10 20:52:16 (GMT) |
commit | e604c02a803f075efecb318f5fb584faf7bf12c4 (patch) | |
tree | b6565e57f8c5610323528b299feb4bd379e8e9b9 /Modules | |
parent | e7a161e60ceb5ca24752404683802f49afe18e8c (diff) | |
download | cpython-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.c | 6 |
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); |