Re: cvs: php-src /main php_ini.c

From: Date: Mon, 14 May 2007 07:48:43 +0000
Subject: Re: cvs: php-src /main php_ini.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-44282@lists.php.net to get a copy of this message
No free()? On 05/12/2007 08:06 PM, Hannes Magnusson wrote:
-/* $Id: php_ini.c,v 1.151 2007/05/10 19:51:19 bjori Exp $ */ +/* $Id: php_ini.c,v 1.152 2007/05/12 16:06:07 bjori Exp $ */ #include "php.h" #include "ext/standard/info.h" @@ -352,12 +352,15 @@ if (sapi_module.executable_location) { binary_location = (char *)emalloc(PATH_MAX); if (!strchr(sapi_module.executable_location, '/')) { - char *path; + char *envpath, *path; int found = 0; - if ((path = getenv("PATH")) != NULL) { + if ((envpath = getenv("PATH")) != NULL) { char *search_dir, search_path[MAXPATHLEN]; char *last; + int pathlen = strlen(envpath) + 1; + path = malloc(pathlen); + memcpy(path, envpath, pathlen); search_dir = php_strtok_r(path, ":", &last); while (search_dir) {
-- Wbr, Antony Dovgal

« previous php.cvs (#44282) next »