From: Lennart Poettering Date: Thu, 28 Jan 2021 15:02:13 +0000 (+0100) Subject: import: use unlink_and_free() + rm_rf_subvolume_and_free() more X-Git-Tag: v248-rc1~237^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0dfb650387c2ca578b25c7239995141528236b99;p=thirdparty%2Fsystemd.git import: use unlink_and_free() + rm_rf_subvolume_and_free() more --- diff --git a/src/import/import-raw.c b/src/import/import-raw.c index f6ee86d6257..3b7031daf6f 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 6baa2f43abf..c772493ece8 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);