summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-06-05 07:18:37 +0000
committernicm <nicm@openbsd.org>2009-06-05 07:18:37 +0000
commit7368b1909d37b63ed7f9271addb636c032f70911 (patch)
treed4def139fcf3e34edd8acd63ded6dc6a727b54eb /usr.bin/tmux/window.c
parentCall setproctitle earlier in the client, and include the socket name. Makes it (diff)
downloadwireguard-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.c4
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();