]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fstab-util: join 'filtered' only if requested by caller
authorMike Yuan <me@yhndnzj.com>
Sat, 15 Feb 2025 17:26:04 +0000 (18:26 +0100)
committerMike Yuan <me@yhndnzj.com>
Sat, 22 Feb 2025 18:26:48 +0000 (19:26 +0100)
src/shared/fstab-util.c

index d6a256c4a77216b63e0c90317ccd54d1402cd499..cccb9e010e8d3265f017c3ca9ff02544073d92cb 100644 (file)
@@ -235,9 +235,11 @@ int fstab_filter_options(
                                 return r;
                 }
 
-                filtered = strv_join_full(filtered_strv, ",", NULL, /* escape_separator = */ true);
-                if (!filtered)
-                        return -ENOMEM;
+                if (ret_filtered) {
+                        filtered = strv_join_full(filtered_strv, ",", NULL, /* escape_separator = */ true);
+                        if (!filtered)
+                                return -ENOMEM;
+                }
         } else
                 for (const char *word = opts;;) {
                         const char *end = word;