From: Barry Warsaw Date: Fri, 18 Aug 2000 05:10:45 +0000 (+0000) Subject: lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already X-Git-Tag: v2.0b1~374 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03;p=thirdparty%2FPython%2Fcpython.git lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already been closed. Don't try to reclose it. Found by Insure. --- diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c index b0677efb3308..5bcbaf2854da 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); }