mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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.
This commit is contained in:
parent
e7a161e60c
commit
e604c02a80
2 changed files with 22 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue