]> granicus.if.org Git - python/commitdiff
Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas
authorCharles-François Natali <neologix@free.fr>
Thu, 29 Sep 2011 17:43:01 +0000 (19:43 +0200)
committerCharles-François Natali <neologix@free.fr>
Thu, 29 Sep 2011 17:43:01 +0000 (19:43 +0200)
Jarosch.

Misc/ACKS
Misc/NEWS
Modules/ossaudiodev.c

index 6c02a79c7a83db63d59e37d8a12fc058e2dbc031..5fd0bfa5da01226011125499015bdc1d367e53c3 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -402,6 +402,7 @@ Kjetil Jacobsen
 Geert Jansen
 Jack Jansen
 Bill Janssen
+Thomas Jarosch
 Drew Jenkins
 Flemming Kjær Jensen
 Jiba
index 132ea5e08b992d768349df42325623c16d710b68..ddcbde11af42e10f9a3a34a6fc062c29d6c58d2f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -50,6 +50,9 @@ Core and Builtins
 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.
 
index b3dfa6256314babb33a9accb27662af7529429e8..647a21e811b4972660a2bbdbd28c319e782b6ce8 100644 (file)
@@ -129,6 +129,7 @@ newossobject(PyObject *arg)
     }
 
     if (ioctl(fd, SNDCTL_DSP_GETFMTS, &afmts) == -1) {
+        close(fd);
         PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
         return NULL;
     }