summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-08-18 05:10:45 (GMT)
committerBarry Warsaw <barry@python.org>2000-08-18 05:10:45 (GMT)
commit4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03 (patch)
treeade78c53dce644c4909016ad09e920cf1392f1a6
parent152fbe88e9fd661c195b2374a0d229998e18e8dc (diff)
downloadcpython-4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03.zip
cpython-4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03.tar.gz
cpython-4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03.tar.bz2
lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already
been closed. Don't try to reclose it. Found by Insure.
-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);
}