mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user