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:
Nicholas Marriott
2013-08-01 23:35:03 +01:00
parent 7ea560261c
commit 1c271852fc
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 {