summaryrefslogtreecommitdiffstats
path: root/Modules/ossaudiodev.c
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-09-29 17:49:37 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-09-29 17:49:37 (GMT)
commit9624a764ff263e04bf9407641828094e07f60bbe (patch)
treeb5503f0abad960a33b2a578d24877f70ac24b00d /Modules/ossaudiodev.c
parenta0702ab1fe6bda8e1cbe1d5fedc3e0ba07e299dd (diff)
parent5a4a1096949335736ccad2b102fd91ebdd2e25b0 (diff)
downloadcpython-9624a764ff263e04bf9407641828094e07f60bbe.zip
cpython-9624a764ff263e04bf9407641828094e07f60bbe.tar.gz
cpython-9624a764ff263e04bf9407641828094e07f60bbe.tar.bz2
Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas
Jarosch.
Diffstat (limited to 'Modules/ossaudiodev.c')
-rw-r--r--Modules/ossaudiodev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index bcab9da..f0fe8c2 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;
}