summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/install.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index 9b72f76662..a1720488e8 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -48,13 +48,12 @@ typedef struct {
static int in_search_path(const char *path, char **search) {
_cleanup_free_ char *parent = NULL;
- int r;
assert(path);
- r = path_get_parent(path, &parent);
- if (r < 0)
- return r;
+ parent = dirname_malloc(path);
+ if (!parent)
+ return -ENOMEM;
return strv_contains(search, parent);
}