lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already

been closed.  Don't try to reclose it.  Found by Insure.
This commit is contained in:
Barry Warsaw 2000-08-18 05:10:45 +00:00
parent 152fbe88e9
commit 4ddd8202bc
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}