From: Lennart Poettering Date: Tue, 11 Aug 2020 12:50:36 +0000 (+0200) Subject: repart: don't unload data we configured explicitly, and fully free all data we match... X-Git-Tag: v247-rc1~369^2~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15d43e30650529f27e450f703b82671aa67c2ca7;p=thirdparty%2Fsystemd.git 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 --- 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;