--- embedaddon/php/ext/standard/basic_functions.c 2012/05/29 12:34:43 1.1.1.2 +++ embedaddon/php/ext/standard/basic_functions.c 2013/07/22 01:44:16 1.1.1.2.2.1 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.1.1.2 2012/05/29 12:34:43 misho Exp $ */ +/* $Id: basic_functions.c,v 1.1.1.2.2.1 2013/07/22 01:44:16 misho Exp $ */ #include "php.h" #include "php_streams.h" @@ -3408,7 +3408,7 @@ static void php_putenv_destructor(putenv_entry *pe) /* SetEnvironmentVariable(pe->key, "bugbug"); #endif putenv(pe->previous_value); -# if defined(PHP_WIN32) || __FreeBSD_version < 700050 +# if defined(PHP_WIN32) efree(pe->previous_value); # endif } else { @@ -4059,7 +4059,7 @@ 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) || __FreeBSD_version < 700050 +#if defined(PHP_WIN32) /* must copy previous value because MSVCRT's putenv can free the string without notice */ pe.previous_value = estrdup(*env); #else