summaryrefslogtreecommitdiffstats
path: root/Modules/linuxaudiodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/linuxaudiodev.c')
-rw-r--r--Modules/linuxaudiodev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c
index b0677ef..5bcbaf2 100644
--- a/Modules/linuxaudiodev.c
+++ b/Modules/linuxaudiodev.c
@@ -110,7 +110,9 @@ newladobject(PyObject *arg)
static void
lad_dealloc(lad_t *xp)
{
- close(xp->x_fd);
+ /* if already closed, don't reclose it */
+ if (xp->x_fd != -1)
+ close(xp->x_fd);
PyObject_Del(xp);
}