imagex_export(): Fix memory leak on error path
[wimlib] / programs / imagex.c
index 30c2e3e8b289e9cd6b4995dfd0d9332e2a3f2814..30ffd3740cae2ff2cf554ff5ea874eba5bb273cd 100644 (file)
@@ -1011,7 +1011,7 @@ static int imagex_export(int argc, const char **argv)
 
                ret = file_writable(dest_wimfile);
                if (ret != 0)
-                       return ret;
+                       goto out;
 
                dest_ctype = wimlib_get_compression_type(dest_w);
                if (compression_type_specified