diff options
-rw-r--r-- | libbb/appletlib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index ebf24066d..5b42a9091 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -280,10 +280,12 @@ int FAST_FUNC find_applet_by_name(const char *name) | |||
280 | 280 | ||
281 | static int external_exists(const char *name, const char *path) | 281 | static int external_exists(const char *name, const char *path) |
282 | { | 282 | { |
283 | char *path1 = xstrdup(path ?: getenv("PATH")); | 283 | char *path0, *path1, *ret; |
284 | char *ret = find_executable(name, &path1); | 284 | |
285 | path0 = path1 = xstrdup(path ?: getenv("PATH")); | ||
286 | ret = find_executable(name, &path1); | ||
285 | free(ret); | 287 | free(ret); |
286 | free(path1); | 288 | free(path0); |
287 | return ret != NULL; | 289 | return ret != NULL; |
288 | } | 290 | } |
289 | 291 | ||