summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/spawn.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-23 05:48:42 +0000
committernicm <nicm@openbsd.org>2020-04-23 05:48:42 +0000
commit928e56dc8f55005879bb6b5f5fece6d8de82f281 (patch)
tree336267febe463ed0a7b8f5b527af85a215a9e74c /usr.bin/tmux/spawn.c
parentRecent changes in usr/mdec require (substantial) growth of the ramdisk. (diff)
downloadwireguard-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/spawn.c')
-rw-r--r--usr.bin/tmux/spawn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/spawn.c b/usr.bin/tmux/spawn.c
index 7d10fbe099a..c19d7e37dea 100644
--- a/usr.bin/tmux/spawn.c
+++ b/usr.bin/tmux/spawn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spawn.c,v 1.21 2020/04/13 20:51:57 nicm Exp $ */
+/* $OpenBSD: spawn.c,v 1.22 2020/04/23 05:48:42 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -366,6 +366,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
window_remove_pane(w, new_wp);
}
sigprocmask(SIG_SETMASK, &oldset, NULL);
+ environ_free(child);
return (NULL);
}
@@ -443,6 +444,8 @@ complete:
sigprocmask(SIG_SETMASK, &oldset, NULL);
window_pane_set_event(new_wp);
+ environ_free(child);
+
if (sc->flags & SPAWN_RESPAWN)
return (new_wp);
if ((~sc->flags & SPAWN_DETACHED) || w->active == NULL) {