diff options
author | 2020-04-23 05:48:42 +0000 | |
---|---|---|
committer | 2020-04-23 05:48:42 +0000 | |
commit | 928e56dc8f55005879bb6b5f5fece6d8de82f281 (patch) | |
tree | 336267febe463ed0a7b8f5b527af85a215a9e74c /usr.bin/tmux/cmd-queue.c | |
parent | Recent changes in usr/mdec require (substantial) growth of the ramdisk. (diff) | |
download | wireguard-openbsd-928e56dc8f55005879bb6b5f5fece6d8de82f281.tar.xz wireguard-openbsd-928e56dc8f55005879bb6b5f5fece6d8de82f281.zip |
Fix a couple of memory leaks, one when creating a new pane and one when
adding formats onto the queue item.
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r-- | usr.bin/tmux/cmd-queue.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index 3292ee5d07b..0c6944474c3 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.90 2020/04/14 06:00:52 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.91 2020/04/23 05:48:42 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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. */ |