From c2bc84aa4dd30c46930994321de0541edf6a30e9 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 27 Apr 2015 22:58:58 +0000 Subject: [PATCH] Do not include unattached clients when trying to find one for target. --- cmd-find.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd-find.c b/cmd-find.c index 14124a36..f7c1ba74 100644 --- a/cmd-find.c +++ b/cmd-find.c @@ -125,11 +125,15 @@ cmd_find_best_client(struct client **clist, u_int csize) c = NULL; if (clist != NULL) { for (i = 0; i < csize; i++) { + if (clist[i]->session == NULL) + continue; if (cmd_find_client_better(clist[i], c)) c = clist[i]; } } else { TAILQ_FOREACH(c_loop, &clients, entry) { + if (c_loop->session == NULL) + continue; if (cmd_find_client_better(c_loop, c)) c = c_loop; }