]> 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:46:37 +0000 (19:46 +0200)
committerCharles-François Natali <neologix@free.fr>
Thu, 29 Sep 2011 17:46:37 +0000 (19:46 +0200)
Jarosch.

Misc/ACKS
Misc/NEWS
Modules/ossaudiodev.c

index 6845faaac6272e090454ba9eaab91843650b7fd5..408d91be8534332897eb35a6cbac0e7b3822a840 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -436,6 +436,7 @@ Bertrand Janin
 Geert Jansen
 Jack Jansen
 Bill Janssen
+Thomas Jarosch
 Drew Jenkins
 Flemming Kjær Jensen
 MunSic Jeong
index b5c75b49cd84d5be0b2cd0f58cdc58d648e16ff9..2f6ef7f280a67c395ff2b3bed2880d7ef3b62b79 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -82,6 +82,9 @@ Tests
 Extension Modules
 -----------------
 
+- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
+  Thomas Jarosch.
+
 - Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
   Thanks to Suman Saha for finding the bug and providing a patch.
 
index cdf6bebc16e7a4ce080c3db5ee8666ac45e46f0d..b38ce5294c017568f33611fc0f5d7ac538d3b5c4 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;
     }