Skip to content

Commit 28d9882

Browse files
author
bwarsaw
committed
lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already
been closed. Don't try to reclose it. Found by Insure. git-svn-id: http://svn.python.org/projects/python/trunk@16873 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 697c7df commit 28d9882

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/linuxaudiodev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ newladobject(PyObject *arg)
110110
static void
111111
lad_dealloc(lad_t *xp)
112112
{
113-
close(xp->x_fd);
113+
/* if already closed, don't reclose it */
114+
if (xp->x_fd != -1)
115+
close(xp->x_fd);
114116
PyObject_Del(xp);
115117
}
116118

0 commit comments

Comments
 (0)