From a3c32841e631590d26884731acd8f44a32516054 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 5 Jun 2009 07:18:37 +0000 Subject: 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 --- window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window.c') 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(); -- cgit