diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-09-16 18:37:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-09-16 18:37:56 +0000 |
commit | 4f63105a8cc79d5502081e3bc45c140cfe5a37f5 (patch) | |
tree | fb00b4c4ad8129b7c6496649b4917a35d26d1739 /usr.bin/tmux/server.c | |
parent | 9124c47097f34475240175f8ab1bbfc8e8da589c (diff) |
Fix some warnings, GitHub issue 2382.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r-- | usr.bin/tmux/server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index f8d0a17bf29..2890d8357f2 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.194 2020/06/18 08:34:22 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.195 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |