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.
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 @@
#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);