--- embedaddon/php/ext/standard/basic_functions.c 2013/10/14 08:17:38 1.1.1.3.2.1 +++ embedaddon/php/ext/standard/basic_functions.c 2014/06/15 20:15:52 1.1.1.3.2.1.2.1 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.1.1.3.2.1 2013/10/14 08:17:38 misho Exp $ */ +/* $Id: basic_functions.c,v 1.1.1.3.2.1.2.1 2014/06/15 20:15:52 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 { @@ -4062,7 +4062,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