From 3cd699042a80b9170ced75e69331df40d10b0da9 Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Thu, 15 Jul 2010 14:43:32 -0300 Subject: [PATCH] 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. --- execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, ":")) { -- 2.47.3