diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-11-24 09:50:04 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-11-29 10:08:51 +0100 |
commit | a2d7c42e97815fdca21b8ce633c5c940d17ad33f (patch) | |
tree | 756e16cd703da07f0c55dbb5547b99a49c07b609 /src/partition | |
parent | repart: Refactor split names (diff) | |
download | systemd-a2d7c42e97815fdca21b8ce633c5c940d17ad33f.tar.xz systemd-a2d7c42e97815fdca21b8ce633c5c940d17ad33f.zip |
repart: Make sure split partition files are cleaned up on failure
Diffstat (limited to 'src/partition')
-rw-r--r-- | src/partition/repart.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c index 860ffdae36..6d94da639f 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -355,7 +355,7 @@ static Partition* partition_free(Partition *p) { free(p->roothash); free(p->split_name_format); - free(p->split_path); + unlink_and_free(p->split_path); return mfree(p); } @@ -6495,6 +6495,9 @@ static int run(int argc, char *argv[]) { (void) context_dump(context, node, /*late=*/ true); + LIST_FOREACH(partitions, p, context->partitions) + p->split_path = mfree(p->split_path); + return 0; } |