]> 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 986dfe94a4b719b16e13c50b94bf6d041887c42d..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;
                 }