[Python-checkins] cpython (2.7): Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas

charles-francois.natali python-checkins at python.org
Thu Sep 29 19:48:54 CEST 2011


http://hg.python.org/cpython/rev/dec00ae64ca8
changeset:   72530:dec00ae64ca8
branch:      2.7
parent:      72513:f612b783bc17
user:        Charles-François Natali <neologix at free.fr>
date:        Thu Sep 29 19:43:01 2011 +0200
summary:
  Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas
Jarosch.

files:
  Misc/ACKS             |  1 +
  Misc/NEWS             |  3 +++
  Modules/ossaudiodev.c |  1 +
  3 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -402,6 +402,7 @@
 Geert Jansen
 Jack Jansen
 Bill Janssen
+Thomas Jarosch
 Drew Jenkins
 Flemming Kjær Jensen
 Jiba
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -50,6 +50,9 @@
 Library
 -------
 
+- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
+  Thomas Jarosch.
+
 - Issue #12931: xmlrpclib now encodes Unicode URI to ISO-8859-1, instead of
   failing with a UnicodeDecodeError.
 
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -129,6 +129,7 @@
     }
 
     if (ioctl(fd, SNDCTL_DSP_GETFMTS, &afmts) == -1) {
+        close(fd);
         PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
         return NULL;
     }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list