Commit 4ddd8202 authored by Barry Warsaw's avatar Barry Warsaw

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

been closed.  Don't try to reclose it.  Found by Insure.
parent 152fbe88
...@@ -110,7 +110,9 @@ newladobject(PyObject *arg) ...@@ -110,7 +110,9 @@ newladobject(PyObject *arg)
static void static void
lad_dealloc(lad_t *xp) 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); PyObject_Del(xp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment