summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-string.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/cmd-string.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/cmd-string.c')
-rw-r--r--usr.bin/tmux/cmd-string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-string.c b/usr.bin/tmux/cmd-string.c
index d151a397bd8..16f8f5a4665 100644
--- a/usr.bin/tmux/cmd-string.c
+++ b/usr.bin/tmux/cmd-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-string.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: cmd-string.c,v 1.2 2009/06/05 07:18:37 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -63,7 +63,7 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
if ((t = strchr(s, ' ')) == NULL && (t = strchr(s, '\t')) == NULL)
t = strchr(s, '\0');
if ((u = strchr(s, '=')) != NULL && u < t) {
- if (putenv((char *) s) != 0) {
+ if (putenv(xstrdup(s)) != 0) {
xasprintf(cause, "assignment failed: %s", s);
return (-1);
}