From: Mike Yuan Date: Sat, 15 Feb 2025 17:26:04 +0000 (+0100) Subject: fstab-util: join 'filtered' only if requested by caller X-Git-Tag: v258-rc1~1270^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f3d98605313d6f343e2a94e5fe315c530b09c78;p=thirdparty%2Fsystemd.git fstab-util: join 'filtered' only if requested by caller --- diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index d6a256c4a77..cccb9e010e8 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -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;