From fbcc6dea0c86e7e4d087f1d4b2de19b211d16647 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 12 Sep 2000 05:37:38 +0000 Subject: matz: 1.6.0 final (hopufully) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 3ff58cc41c..62d6145148 100644 --- a/hash.c +++ b/hash.c @@ -1055,7 +1055,8 @@ ruby_setenv(name, value) environ = tmpenv; /* tell exec where it is now */ } if (!value) { - free(environ[i]); + if (environ[i] != origenviron[i]) + free(environ[i]); while (environ[i]) { environ[i] = environ[i+1]; i++; @@ -1067,7 +1068,8 @@ ruby_setenv(name, value) environ[i+1] = 0; /* make sure it's null terminated */ } else { - free(environ[i]); + if (environ[i] != origenviron[i]) + free(environ[i]); } environ[i] = ALLOC_N(char, strlen(name) + strlen(value) + 2); #ifndef MSDOS -- cgit v1.2.3