diff options
author | 2009-06-05 07:18:37 +0000 | |
---|---|---|
committer | 2009-06-05 07:18:37 +0000 | |
commit | 7368b1909d37b63ed7f9271addb636c032f70911 (patch) | |
tree | d4def139fcf3e34edd8acd63ded6dc6a727b54eb /usr.bin/tmux/window.c | |
parent | Call setproctitle earlier in the client, and include the socket name. Makes it (diff) | |
download | wireguard-openbsd-7368b1909d37b63ed7f9271addb636c032f70911.tar.xz wireguard-openbsd-7368b1909d37b63ed7f9271addb636c032f70911.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 '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(); |