summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-09-16 18:37:55 +0000
committernicm <nicm@openbsd.org>2020-09-16 18:37:55 +0000
commit10e1651a8cd92b777b7e280ce1dd59f19c1f7460 (patch)
tree44e9c574f4bb8ce08fccea79c15fd1e993d00164 /usr.bin/tmux/server.c
parentsimple mdoc(7) fixes: (diff)
downloadwireguard-openbsd-10e1651a8cd92b777b7e280ce1dd59f19c1f7460.tar.xz
wireguard-openbsd-10e1651a8cd92b777b7e280ce1dd59f19c1f7460.zip
Fix some warnings, GitHub issue 2382.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c10
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);