From 15d43e30650529f27e450f703b82671aa67c2ca7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 11 Aug 2020 14:50:36 +0200 Subject: [PATCH] repart: don't unload data we configured explicitly, and fully free all data we match to disk The context_unload_partition_table() call is supposed to remove all data from the loaded partitions about how we mapped it to existing partitions on disk, but it should leave everything we parsed from the definition files in place. We mostly got this right, except for two cases: 1. new_uuid is parsed from the definition files and should stay 2. current_label is read from the existing partition table and should be freed --- src/partition/repart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/partition/repart.c b/src/partition/repart.c index 572db3bdc40..4768600a8dc 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -1563,7 +1563,8 @@ static void context_unload_partition_table(Context *context) { p->padding_area = NULL; p->allocated_to_area = NULL; - p->current_uuid = p->new_uuid = SD_ID128_NULL; + p->current_uuid = SD_ID128_NULL; + p->current_label = mfree(p->current_label); } context->start = UINT64_MAX; -- 2.47.3