summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-11-02 05:26:07 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-11-02 05:26:07 (GMT)
commit7b631793abc97edbcd26af56864961e264a86a24 (patch)
tree78b974c54962420022a048f280d865c0abb71095
parent245a5ab31bbaa48776736bdd101b0df7164125c9 (diff)
downloadcpython-7b631793abc97edbcd26af56864961e264a86a24.zip
cpython-7b631793abc97edbcd26af56864961e264a86a24.tar.gz
cpython-7b631793abc97edbcd26af56864961e264a86a24.tar.bz2
Bug #1344508, Fix UNIX mmap leaking file descriptors. Will backport.
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/mmapmodule.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index e88311f..9b3f381 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 dd7c16f..73797cb 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);