From f3689f637f5ac0fb6c231a470e65b39aa5e9ba20 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 17 May 2017 09:57:29 -0700 Subject: [PATCH] os: Set oc->fd to -1 when connection is closed This ensures that we don't use the now-closed file descriptor in the future. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- os/connection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/connection.c b/os/connection.c index 07c16eacf..229bbe745 100644 --- a/os/connection.c +++ b/os/connection.c @@ -772,6 +772,7 @@ CloseDownFileDescriptor(OsCommPtr oc) _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); oc->trans_conn = NULL; + oc->fd = -1; } }