aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c8
1 files changed, 5 insertions, 3 deletions
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);