From 1a2837de2180cc871239a0627903a142a754e189 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 24 Jan 2013 23:44:50 -0600 Subject: [PATCH 1/1] wimlib_mount_image(): Delete staging dir on error paths --- src/mount_image.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mount_image.c b/src/mount_image.c index 28a807d7..a05a822d 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -2499,6 +2499,12 @@ WIMLIBAPI int wimlib_mount_image(WIMStruct *wim, int image, const char *dir, if (ret) ret = WIMLIB_ERR_FUSE; + + /* Try to delete the staging directory if a deletion wasn't yet + * attempted due to an earlier error */ + if (ctx.staging_dir_name) + delete_staging_dir(&ctx); + out_free_dir_copy: FREE(dir_copy); out_unlock: -- 2.43.0