edink Sun Dec 10 01:23:41 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard basic_functions.c
Log:
Fixed by #39751 by KevinJohnHoffman at gmail dot com
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.33&r2=1.725.2.31.2.34&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.33
php-src/ext/standard/basic_functions.c:1.725.2.31.2.34
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.33 Sat Dec 9
18:00:52 2006
+++ php-src/ext/standard/basic_functions.c Sun Dec 10 01:23:41 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.31.2.33 2006/12/09 18:00:52 bjori Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.34 2006/12/10 01:23:41 edink Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -3837,6 +3837,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);
@@ -4430,7 +4433,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;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php