]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/mount-util.c
Merge pull request #29748 from poettering/tgtmode
[thirdparty/systemd.git] / src / shared / mount-util.c
index af4729b9dc7dc1ee66f9817d739a0db3aa0b5c76..4f2acce513d4109ee0061f57d70a6111089fabbd 100644 (file)
@@ -1378,12 +1378,12 @@ int remount_idmap_fd(
         int *mount_fds = NULL;
         size_t n_mounts_fds = 0;
 
-        CLEANUP_ARRAY(mount_fds, n_mounts_fds, close_many_and_free);
-
         mount_fds = new(int, n);
         if (!mount_fds)
                 return log_oom_debug();
 
+        CLEANUP_ARRAY(mount_fds, n_mounts_fds, close_many_and_free);
+
         for (size_t i = 0; i < n; i++) {
                 int mntfd;