From 869c0e860fcf0851ef1751ca9187599913ca056a Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 16 Sep 2020 18:37:55 +0000 Subject: Fix some warnings, GitHub issue 2382. --- server.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index f07bf673..b2c75e11 100644 --- a/server.c +++ b/server.c @@ -158,7 +158,7 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base, { int pair[2]; sigset_t set, oldset; - struct client *c; + struct client *c = NULL; char *cause = NULL; sigfillset(&set); @@ -224,9 +224,11 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base, } if (cause != NULL) { - cmdq_append(c, cmdq_get_error(cause)); + if (c != NULL) { + cmdq_append(c, cmdq_get_error(cause)); + c->flags |= CLIENT_EXIT; + } free(cause); - c->flags |= CLIENT_EXIT; } server_add_accept(0); -- cgit