]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/namespace: use FOREACH_ARRAY at one more place
authorMike Yuan <me@yhndnzj.com>
Fri, 26 Apr 2024 03:07:59 +0000 (11:07 +0800)
committerMike Yuan <me@yhndnzj.com>
Sat, 27 Apr 2024 06:30:29 +0000 (14:30 +0800)
src/core/namespace.c

index 763520842d66af3fa896160e18c3576cc0b39ddd..88f5d0f1582b11d9be524019448c106b0911883b 100644 (file)
@@ -2644,9 +2644,9 @@ int setup_namespace(const NamespaceParameters *p, char **error_path) {
 void bind_mount_free_many(BindMount *b, size_t n) {
         assert(b || n == 0);
 
-        for (size_t i = 0; i < n; i++) {
-                free(b[i].source);
-                free(b[i].destination);
+        FOREACH_ARRAY(i, b, n) {
+                free(i->source);
+                free(i->destination);
         }
 
         free(b);