aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-05 07:18:37 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-05 07:18:37 +0000
commita3c32841e631590d26884731acd8f44a32516054 (patch)
tree21d98a4c3c0277a37e1daba692c1fea805d6f6b8 /window.c
parent1156467726a21f2126e0b382223118298c623b22 (diff)
downloadrtmux-a3c32841e631590d26884731acd8f44a32516054.tar.gz
rtmux-a3c32841e631590d26884731acd8f44a32516054.tar.bz2
rtmux-a3c32841e631590d26884731acd8f44a32516054.zip
strdup the input to putenv to avoid in one case passing a string that is later
freed and in the other const strings. looks sane to millert, ok ray
Diffstat (limited to 'window.c')
-rw-r--r--window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/window.c b/window.c
index 06733201..aeed4bc9 100644
--- a/window.c
+++ b/window.c
@@ -473,7 +473,7 @@ window_pane_spawn(struct window_pane *wp,
if (chdir(wp->cwd) != 0)
chdir("/");
for (envq = envp; *envq != NULL; envq++) {
- if (putenv((char *) *envq) != 0)
+ if (putenv(xstrdup(*envq)) != 0)
fatal("putenv failed");
}
sigreset();