cvs: php-src /ext/standard basic_functions.c
| From: | Edin Kadribasic | Date: | Sun, 10 Dec 2006 01:24:13 +0000 |
| Subject: | cvs: php-src /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42028@lists.php.net to get a copy of this message | ||
edink Sun Dec 10 01:24:13 2006 UTC
Modified files:
/php-src/ext/standard basic_functions.c
Log:
MFB: Fixed by #39751 by KevinJohnHoffman at gmail dot com
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.830&r2=1.831&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.830 php-src/ext/standard/basic_functions.c:1.831
--- php-src/ext/standard/basic_functions.c:1.830 Wed Dec 6 17:42:47 2006
+++ php-src/ext/standard/basic_functions.c Sun Dec 10 01:24:13 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.830 2006/12/06 17:42:47 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.831 2006/12/10 01:24:13 edink Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -3852,6 +3852,9 @@
SetEnvironmentVariable(pe->key, "bugbug");
#endif
putenv(pe->previous_value);
+# if defined(PHP_WIN32)
+ efree(pe->previous_value);
+# endif
} else {
# if HAVE_UNSETENV
unsetenv(pe->key);
@@ -4419,7 +4422,12 @@
pe.previous_value = NULL;
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /*
found it */
+#if defined(PHP_WIN32)
+ /* must copy previous value because MSVCRT's putenv can free the string without notice */
+ pe.previous_value = estrndup(*env, 1024);
+#else
pe.previous_value = *env;
+#endif
break;
}
}