1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-22 06:50:18 +03:00

fstab-util: join 'filtered' only if requested by caller

This commit is contained in:
Mike Yuan 2025-02-15 18:26:04 +01:00
parent 66584a9335
commit 2f3d986053
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View 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;