Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd can

be NULL. Avoids crash when a command in a command client can't be
parsed.
This commit is contained in:
nicm
2013-10-10 11:45:28 +00:00
parent 7c71c3e27d
commit 4c9f41f1ad
3 changed files with 11 additions and 11 deletions

View File

@ -73,9 +73,9 @@ control_callback(struct client *c, int closed, unused void *data)
c->cmdq->time = time(NULL);
c->cmdq->number++;
cmdq_guard(c->cmdq, "begin");
cmdq_guard(c->cmdq, "begin", 1);
control_write(c, "parse error: %s", cause);
cmdq_guard(c->cmdq, "error");
cmdq_guard(c->cmdq, "error", 1);
free(cause);
} else {