diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/path-util.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 0b0f0da760..a681065565 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -22,7 +22,7 @@ #include "time-util.h" int path_split_and_make_absolute(const char *p, char ***ret) { - char **l; + _cleanup_strv_free_ char **l = NULL; int r; assert(p); @@ -33,12 +33,10 @@ int path_split_and_make_absolute(const char *p, char ***ret) { return -ENOMEM; r = path_strv_make_absolute_cwd(l); - if (r < 0) { - strv_free(l); + if (r < 0) return r; - } - *ret = l; + *ret = TAKE_PTR(l); return r; } |