]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/mount-util.c
macro: introduce TAKE_PTR() macro
[thirdparty/systemd.git] / src / basic / mount-util.c
index 8151b3a4e4f7305babe535895d56d31590d4935c..b6e7c9401704eb3f4be94b620af14860b3aea367 100644 (file)
@@ -81,10 +81,8 @@ int name_to_handle_at_loop(
 
                 if (name_to_handle_at(fd, path, h, &mnt_id, flags) >= 0) {
 
-                        if (ret_handle) {
-                                *ret_handle = h;
-                                h = NULL;
-                        }
+                        if (ret_handle)
+                                *ret_handle = TAKE_PTR(h);
 
                         if (ret_mnt_id)
                                 *ret_mnt_id = mnt_id;
@@ -951,8 +949,7 @@ int mount_option_mangle(
         }
 
         *ret_mount_flags = mount_flags;
-        *ret_remaining_options = ret;
-        ret = NULL;
+        *ret_remaining_options = TAKE_PTR(ret);
 
         return 0;
 }