]> wimlib.net Git - wimlib/commitdiff
wimlib_mount_image(): Delete staging dir on error paths
authorEric Biggers <ebiggers3@gmail.com>
Fri, 25 Jan 2013 05:44:50 +0000 (23:44 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 25 Jan 2013 05:45:51 +0000 (23:45 -0600)
src/mount_image.c

index 28a807d7afdfd7d26537a57a97d99e5203564841..a05a822d10d78d0f2dc92b94076acdba5d7a36b4 100644 (file)
@@ -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: