diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 200435caae..21057154c5 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -104,8 +104,7 @@ static int extract_prefix(const char *path, char **ret) { if (!filename_is_valid(name)) return -EINVAL; - *ret = name; - name = NULL; + *ret = TAKE_PTR(name); return 0; }