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
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php