import: use unlink_and_free() + rm_rf_subvolume_and_free() more

This commit is contained in:
Lennart Poettering
2021-01-29 16:40:20 +01:00
parent be7c98c240
commit 0dfb650387
2 changed files with 2 additions and 8 deletions
+1 -4
View File
@@ -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);
+1 -4
View File
@@ -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);