From: Eric Biggers Date: Fri, 25 Jan 2013 05:44:50 +0000 (-0600) Subject: wimlib_mount_image(): Delete staging dir on error paths X-Git-Tag: v1.2.4~14 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=1a2837de2180cc871239a0627903a142a754e189;ds=sidebyside wimlib_mount_image(): Delete staging dir on error paths --- 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: