mirror of
https://github.com/systemd/systemd.git
synced 2026-07-13 02:51:14 +00:00
path-util: use _cleanup_
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user