unit-name: use TAKE_PTR() where appropriate

This commit is contained in:
Lennart Poettering 2020-05-25 00:37:15 +02:00
parent ab19db01ae
commit 5aec5c751a

View file

@ -695,7 +695,8 @@ good:
}
int slice_build_parent_slice(const char *slice, char **ret) {
char *s, *dash;
_cleanup_free_ char *s = NULL;
char *dash;
int r;
assert(slice);
@ -718,13 +719,11 @@ int slice_build_parent_slice(const char *slice, char **ret) {
strcpy(dash, ".slice");
else {
r = free_and_strdup(&s, SPECIAL_ROOT_SLICE);
if (r < 0) {
free(s);
if (r < 0)
return r;
}
}
*ret = s;
*ret = TAKE_PTR(s);
return 1;
}