From: Charles-François Natali Date: Thu, 29 Sep 2011 17:46:37 +0000 (+0200) Subject: Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas X-Git-Tag: v3.3.0a1~1438^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a4a1096949335736ccad2b102fd91ebdd2e25b0;p=python Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas Jarosch. --- diff --git a/Misc/ACKS b/Misc/ACKS index 6845faaac6..408d91be85 100644 --- 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 diff --git a/Misc/NEWS b/Misc/NEWS index b5c75b49cd..2f6ef7f280 100644 --- 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. diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index cdf6bebc16..b38ce5294c 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -129,6 +129,7 @@ newossobject(PyObject *arg) } if (ioctl(fd, SNDCTL_DSP_GETFMTS, &afmts) == -1) { + close(fd); PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename); return NULL; }