=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-queue.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/tmux/cmd-queue.c 2015/02/05 10:26:29 1.21 --- src/usr.bin/tmux/cmd-queue.c 2015/02/12 09:56:19 1.22 *************** *** 1,4 **** ! /* $OpenBSD: cmd-queue.c,v 1.21 2015/02/05 10:26:29 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-queue.c,v 1.22 2015/02/12 09:56:19 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott *************** *** 163,168 **** --- 163,169 ---- int empty, flags; char s[1024]; + cmdq->references++; notify_disable(); empty = TAILQ_EMPTY(&cmdq->queue); *************** *** 220,230 **** if (cmdq->client_exit > 0) cmdq->client->flags |= CLIENT_EXIT; if (cmdq->emptyfn != NULL) ! cmdq->emptyfn(cmdq); /* may free cmdq */ empty = 1; out: notify_enable(); return (empty); } --- 221,233 ---- if (cmdq->client_exit > 0) cmdq->client->flags |= CLIENT_EXIT; if (cmdq->emptyfn != NULL) ! cmdq->emptyfn(cmdq); empty = 1; out: notify_enable(); + cmdq_free(cmdq); + return (empty); }