portablectl: coccinelle says we should use TAKE_PTR() here, do so
authorLennart Poettering <lennart@poettering.net>
Thu, 31 May 2018 10:05:20 +0000 (12:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 May 2018 10:05:20 +0000 (12:05 +0200)
src/portable/portablectl.c

index 200435c..2105715 100644 (file)
@@ -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;
 }