]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: use strextend_with_separator()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 May 2021 05:19:22 +0000 (14:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 May 2021 09:18:56 +0000 (18:18 +0900)
src/core/dbus-util.c

index 44a2ccfca066d7da719151d8376c15d4488ee1e6..ca9b399d8c91b0de1d8b6c8ee26f560d8baeb34a 100644 (file)
@@ -181,7 +181,7 @@ int bus_read_mount_options(
                 return r;
 
         while ((r = sd_bus_message_read(message, "(ss)", &partition, &mount_options)) > 0) {
-                _cleanup_free_ char *previous = NULL, *escaped = NULL;
+                _cleanup_free_ char *escaped = NULL;
                 _cleanup_free_ MountOptions *o = NULL;
                 PartitionDesignator partition_designator;
 
@@ -198,9 +198,7 @@ int bus_read_mount_options(
                 if (!escaped)
                         return -ENOMEM;
 
-                previous = TAKE_PTR(format_str);
-                format_str = strjoin(previous, previous ? separator : "", partition, ":", escaped);
-                if (!format_str)
+                if (!strextend_with_separator(&format_str, separator, partition, ":", escaped))
                         return -ENOMEM;
 
                 o = new(MountOptions, 1);