From 906dfe9f5c217bb026929120b346722e5cb32106 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 23 Apr 2020 05:48:42 +0000 Subject: Fix a couple of memory leaks, one when creating a new pane and one when adding formats onto the queue item. --- cmd-queue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd-queue.c') diff --git a/cmd-queue.c b/cmd-queue.c index 5df30940..59f86c64 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -243,8 +243,12 @@ cmdq_copy_state(struct cmdq_state *state) void cmdq_free_state(struct cmdq_state *state) { - if (--state->references == 0) - free(state); + if (--state->references != 0) + return; + + if (state->formats != NULL) + format_free(state->formats); + free(state); } /* Add a format to command queue. */ -- cgit