diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-05 07:18:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-05 07:18:38 +0000 |
commit | c8973f6a7a2c129a1ae30c91186d1489e0bbb1df (patch) | |
tree | 62c271e05abdafda077df1e8e36c7b72f9502da2 /usr.bin/tmux/window.c | |
parent | cb5b2fcc5245f86f074e17e161cd0c3eea1c68ac (diff) |
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 'usr.bin/tmux/window.c')
-rw-r--r-- | usr.bin/tmux/window.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 0f328c62b1e..e282336e863 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.2 2009/06/05 07:18:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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(); |