]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: fix memleak 38756/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Sep 2025 21:52:01 +0000 (06:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Sep 2025 21:52:17 +0000 (06:52 +0900)
Fixes a bug in 1a0541d44c78ced78a566051ec8f63417370aeaa (v256).

src/repart/repart.c

index 961d5d0e334c374db16c3ae71a5b1d8dc661ea7e..a1c49b3b02f077bce6d214e8fd32d3fc434e5288 100644 (file)
@@ -7859,7 +7859,7 @@ static int context_fstab(Context *context) {
         fputs(AUTOMATIC_FSTAB_HEADER_START "\n", f);
 
         LIST_FOREACH(partitions, p, context->partitions) {
-                _cleanup_free_ char *what = NULL, *options = NULL;
+                _cleanup_free_ char *what = NULL;
 
                 if (!need_fstab_one(p))
                         continue;
@@ -7869,6 +7869,8 @@ static int context_fstab(Context *context) {
                         return r;
 
                 FOREACH_ARRAY(mountpoint, p->mountpoints, p->n_mountpoints) {
+                        _cleanup_free_ char *options = NULL;
+
                         r = partition_pick_mount_options(
                                         p->type.designator,
                                         p->format,