Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2015-04-28 09:10:51 +01:00
commit 7d98c51805
2 changed files with 7 additions and 1 deletions

2
cfg.c
View File

@ -139,6 +139,7 @@ cfg_print_causes(struct cmd_q *cmdq)
free(cfg_causes); free(cfg_causes);
cfg_causes = NULL; cfg_causes = NULL;
cfg_ncauses = 0;
} }
void void
@ -160,4 +161,5 @@ cfg_show_causes(struct session *s)
free(cfg_causes); free(cfg_causes);
cfg_causes = NULL; cfg_causes = NULL;
cfg_ncauses = 0;
} }

View File

@ -125,13 +125,17 @@ cmd_find_best_client(struct client **clist, u_int csize)
c = NULL; c = NULL;
if (clist != NULL) { if (clist != NULL) {
for (i = 0; i < csize; i++) { for (i = 0; i < csize; i++) {
if (clist[i]->session == NULL)
continue;
if (cmd_find_client_better(clist[i], c)) if (cmd_find_client_better(clist[i], c))
c = clist[i]; c = clist[i];
} }
} else { } else {
TAILQ_FOREACH(c_loop, &clients, entry) { TAILQ_FOREACH(c_loop, &clients, entry) {
if (c_loop->session == NULL)
continue;
if (cmd_find_client_better(c_loop, c)) if (cmd_find_client_better(c_loop, c))
c_loop = c; c = c_loop;
} }
} }
return (c); return (c);