From: Ramiro Polla Date: Thu, 15 Jul 2010 17:43:32 +0000 (-0300) Subject: x_strdup() path in find_executable_in_path() instead of in find_executable() X-Git-Tag: v3.1~189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cd699042a80b9170ced75e69331df40d10b0da9;p=thirdparty%2Fccache.git x_strdup() path in find_executable_in_path() instead of in find_executable() find_executable_in_path() now only frees the memory it has allocated itself. --- diff --git a/execute.c b/execute.c index f441402cc..50e96b143 100644 --- a/execute.c +++ b/execute.c @@ -103,8 +103,6 @@ char *find_executable(const char *name, const char *exclude_name) return NULL; } - path = x_strdup(path); - return find_executable_in_path(name, exclude_name, path); } @@ -113,6 +111,8 @@ find_executable_in_path(const char *name, const char *exclude_name, char *path) { char *tok; + path = x_strdup(path); + /* search the path looking for the first compiler of the right name that isn't us */ for (tok=strtok(path,":"); tok; tok = strtok(NULL, ":")) {