diff options
author | Damien Miller <djm@mindrot.org> | 2000-03-15 11:23:48 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-03-15 11:23:48 +1100 |
commit | f09b07a971f64cf69f2c45a364c3d56559f7c1c3 (patch) | |
tree | 2a4b60794ed6f366a89646c24f48a944522907e1 /bsd-misc.c | |
parent | a1ad4802fff669b20c49cbd9b682460085b2d50a (diff) |
- Don't free argument to putenv() after use (in setenv() replacement).
Report from Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Diffstat (limited to 'bsd-misc.c')
-rw-r--r-- | bsd-misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bsd-misc.c b/bsd-misc.c index 99fe29816..83cb0b85d 100644 --- a/bsd-misc.c +++ b/bsd-misc.c | |||
@@ -154,7 +154,10 @@ int setenv(const char *name, const char *value, int overwrite) | |||
154 | 154 | ||
155 | result = putenv(env_string); | 155 | result = putenv(env_string); |
156 | 156 | ||
157 | xfree(env_string); | 157 | /* Putenv doesn't copy the env_string, so we need to keep a copy of it */ |
158 | /* around. This leaks a bit of memory, but it doesn't matter */ | ||
159 | /* for our (OpenSSH port ) use: setenv is only used twice in ssh-agent */ | ||
160 | /* xfree(env_string); */ | ||
158 | 161 | ||
159 | return(result); | 162 | return(result); |
160 | } | 163 | } |