aboutsummaryrefslogtreecommitdiff
path: root/cmd-queue.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-02-14 23:54:07 +0000
committerThomas Adam <thomas@xteddy.org>2015-02-14 23:54:07 +0000
commitffb83d23e17e99589f46edc3e08f78dd32936e4e (patch)
treeeaa685cd8ce41ba6c3114037bf42d22999ae4f9a /cmd-queue.c
parentb4750e4c352f70ce515bed1279d8561a288f1f1b (diff)
parent4d05d8830482f8d5b5f812d082f1332090fcf027 (diff)
downloadrtmux-ffb83d23e17e99589f46edc3e08f78dd32936e4e.tar.gz
rtmux-ffb83d23e17e99589f46edc3e08f78dd32936e4e.tar.bz2
rtmux-ffb83d23e17e99589f46edc3e08f78dd32936e4e.zip
Merge branch 'obsd-master'
Conflicts: Makefile
Diffstat (limited to 'cmd-queue.c')
-rw-r--r--cmd-queue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index 58282c8f..6be532a8 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -163,6 +163,7 @@ cmdq_continue(struct cmd_q *cmdq)
int empty, flags;
char s[1024];
+ cmdq->references++;
notify_disable();
empty = TAILQ_EMPTY(&cmdq->queue);
@@ -220,11 +221,13 @@ empty:
if (cmdq->client_exit > 0)
cmdq->client->flags |= CLIENT_EXIT;
if (cmdq->emptyfn != NULL)
- cmdq->emptyfn(cmdq); /* may free cmdq */
+ cmdq->emptyfn(cmdq);
empty = 1;
out:
notify_enable();
+ cmdq_free(cmdq);
+
return (empty);
}