diff options
Diffstat (limited to 'pseudo_client.c')
-rw-r--r-- | pseudo_client.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/pseudo_client.c b/pseudo_client.c index c4dd43d..7f30467 100644 --- a/pseudo_client.c +++ b/pseudo_client.c @@ -1226,7 +1226,7 @@ base_path(int dirfd, const char *path, int leave_last) { if (!path) return NULL; if (!*path) - return strdup(""); + return ""; if (path[0] != '/') { if (dirfd != -1 && dirfd != AT_FDCWD) { @@ -1746,18 +1746,15 @@ pseudo_exec_path(const char *filename, int search_path) { pseudo_diag("couldn't allocate intermediate path.\n"); candidate = NULL; } - free(dir); } if (candidate && !stat(candidate, &buf) && !S_ISDIR(buf.st_mode) && (buf.st_mode & 0111)) { pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "exec_path: %s => %s\n", filename, candidate); pseudo_magic(); return candidate; - } else { - free(candidate); } } /* blind guess being as good as anything */ pseudo_magic(); - return strdup(filename); + return filename; } |