]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: Make ret argument optional for path_extract_directory()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Aug 2023 16:29:25 +0000 (18:29 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Aug 2023 16:46:06 +0000 (18:46 +0200)
src/basic/path-util.c

index f832f85c689e08f1bc80952dfd020f538fddb768..a4c9d332f0447a23d271dd4cd68a3777400694e2 100644 (file)
@@ -1116,7 +1116,9 @@ int path_extract_directory(const char *path, char **ret) {
         if (!path_is_valid(a))
                 return -EINVAL;
 
-        *ret = TAKE_PTR(a);
+        if (ret)
+                *ret = TAKE_PTR(a);
+
         return 0;
 }