summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-03-15 11:23:48 +1100
committerDamien Miller <djm@mindrot.org>2000-03-15 11:23:48 +1100
commitf09b07a971f64cf69f2c45a364c3d56559f7c1c3 (patch)
tree2a4b60794ed6f366a89646c24f48a944522907e1
parenta1ad4802fff669b20c49cbd9b682460085b2d50a (diff)
- Don't free argument to putenv() after use (in setenv() replacement).
Report from Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
-rw-r--r--ChangeLog2
-rw-r--r--bsd-misc.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fbe5473..7d287768 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
20000315
- Fix broken CFLAGS handling during search for OpenSSL. Fixes va_list
problems with gcc/Solaris.
+ - Don't free argument to putenv() after use (in setenv() replacement).
+ Report from Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
20000314
- Include macro for IN6_IS_ADDR_V4MAPPED. Report from
diff --git a/bsd-misc.c b/bsd-misc.c
index 99fe2981..83cb0b85 100644
--- a/bsd-misc.c
+++ b/bsd-misc.c
@@ -154,7 +154,10 @@ int setenv(const char *name, const char *value, int overwrite)
result = putenv(env_string);
- xfree(env_string);
+ /* Putenv doesn't copy the env_string, so we need to keep a copy of it */
+ /* around. This leaks a bit of memory, but it doesn't matter */
+ /* for our (OpenSSH port ) use: setenv is only used twice in ssh-agent */
+/* xfree(env_string); */
return(result);
}