diff options
author | Antony Dovgal <tony2001@php.net> | 2007-05-14 12:19:34 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-05-14 12:19:34 +0000 |
commit | d85fc29edf8d06f1f71bebf3db5985f5e674b4c5 (patch) | |
tree | 38289e81a0e852b3248b888cf4155a83be8d7891 /main | |
parent | 7d3c91bed3a85add5593dfce9591784abf8fd188 (diff) | |
download | php-git-d85fc29edf8d06f1f71bebf3db5985f5e674b4c5.tar.gz |
MFH
Diffstat (limited to 'main')
-rw-r--r-- | main/php_ini.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index b92a83b193..b7ff09b51a 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -360,11 +360,10 @@ int php_init_config(TSRMLS_D) 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); + path = estrdup(envpath); search_dir = php_strtok_r(path, ":", &last); + while (search_dir) { snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location); if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) { @@ -373,6 +372,7 @@ int php_init_config(TSRMLS_D) } search_dir = php_strtok_r(NULL, ":", &last); } + efree(path); } if (!found) { efree(binary_location); |