Browse Source

Fixed by #39751 by KevinJohnHoffman at gmail dot com

experimental/5.2-WITH_DRCP
Edin Kadribasic 20 years ago
parent
commit
42e1c9a1e0
  1. 8
      ext/standard/basic_functions.c

8
ext/standard/basic_functions.c

@ -3837,6 +3837,9 @@ static void php_putenv_destructor(putenv_entry *pe)
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 @@ PHP_FUNCTION(putenv)
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;
}
}

Loading…
Cancel
Save