]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/path-util.c
path-util: make use of TAKE_PTR() where we can
[thirdparty/systemd.git] / src / basic / path-util.c
index ba13de01ff0b194f6cc9925fe0fcd6e7078458d4..c4e022b3a1187806635f771c7825322b42e4913c 100644 (file)
@@ -640,10 +640,8 @@ int find_binary(const char *name, char **ret) {
                 if (access(j, X_OK) >= 0) {
                         /* Found it! */
 
-                        if (ret) {
-                                *ret = path_simplify(j, false);
-                                j = NULL;
-                        }
+                        if (ret)
+                                *ret = path_simplify(TAKE_PTR(j), false);
 
                         return 0;
                 }
@@ -1051,7 +1049,7 @@ int systemd_installation_has_version(const char *root, unsigned minimal_version)
                 if (!path)
                         return -ENOMEM;
 
-                r = glob_extend(&names, path);
+                r = glob_extend(&names, path, 0);
                 if (r == -ENOENT)
                         continue;
                 if (r < 0)