From 0dfb650387c2ca578b25c7239995141528236b99 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Jan 2021 16:02:13 +0100 Subject: [PATCH] import: use unlink_and_free() + rm_rf_subvolume_and_free() more --- src/import/import-raw.c | 5 +---- src/import/import-tar.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/import/import-raw.c b/src/import/import-raw.c index f6ee86d625..3b7031daf6 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -64,10 +64,7 @@ RawImport* raw_import_unref(RawImport *i) { sd_event_unref(i->event); - if (i->temp_path) { - (void) unlink(i->temp_path); - free(i->temp_path); - } + unlink_and_free(i->temp_path); import_compress_free(&i->compress); diff --git a/src/import/import-tar.c b/src/import/import-tar.c index 6baa2f43ab..c772493ece 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -73,10 +73,7 @@ TarImport* tar_import_unref(TarImport *i) { (void) wait_for_terminate(i->tar_pid, NULL); } - if (i->temp_path) { - (void) rm_rf(i->temp_path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME); - free(i->temp_path); - } + rm_rf_subvolume_and_free(i->temp_path); import_compress_free(&i->compress);