diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-25 15:58:58 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-25 15:58:58 +0000 |
commit | fbcee9f114bb42810ee824c2bc1bbe4cd4a7a5b2 (patch) | |
tree | 41fd6a2df74443b8ff7115de40b539b4a081ec0b /window.c | |
parent | 0e95769b435d1e21859efce6c1687e4343090ffc (diff) | |
download | rtmux-fbcee9f114bb42810ee824c2bc1bbe4cd4a7a5b2.tar.gz rtmux-fbcee9f114bb42810ee824c2bc1bbe4cd4a7a5b2.tar.bz2 rtmux-fbcee9f114bb42810ee824c2bc1bbe4cd4a7a5b2.zip |
strdup the input to putenv to avoid in one case passing a string that is later
freed and in the other const strings.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.78 2009-05-19 13:32:55 tcunha Exp $ */ +/* $OpenBSD: window.c,v 1.2 2009/06/05 07:18:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -487,7 +487,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(); |