From: Neal Norwitz Date: Wed, 2 Nov 2005 05:26:07 +0000 (+0000) Subject: Bug #1344508, Fix UNIX mmap leaking file descriptors. Will backport. X-Git-Tag: v2.5a0~1204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b631793abc97edbcd26af56864961e264a86a24;p=thirdparty%2FPython%2Fcpython.git Bug #1344508, Fix UNIX mmap leaking file descriptors. Will backport. --- diff --git a/Misc/NEWS b/Misc/NEWS index e88311f8ed82..9b3f3814bda1 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -177,6 +177,8 @@ Core and builtins Extension Modules ----------------- +- Bug #1344508, Fix UNIX mmap leaking file descriptors + - Patch #1338314, Bug #1336623: fix tarfile so it can extract REGTYPE directories from tarfiles written by old programs. diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index dd7c16f8a685..73797cb5fe28 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -99,6 +99,7 @@ mmap_object_dealloc(mmap_object *m_obj) #endif /* MS_WINDOWS */ #ifdef UNIX + close(m_obj->fd); if (m_obj->data!=NULL) { msync(m_obj->data, m_obj->size, MS_SYNC); munmap(m_obj->data, m_obj->size);