X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fadd_image.c;h=86ba9f0b3d277ede7bb588ba2baf57e754783907;hb=9a20d1f99bd5dcd22e55300a5e29748486e585d7;hp=0aed1deb3a11d5ce2bd868783b641f32f8672742;hpb=2b14c2bfd6d0a7a17433dd8529cfc8b7d969c4b0;p=wimlib diff --git a/src/add_image.c b/src/add_image.c index 0aed1deb..86ba9f0b 100644 --- a/src/add_image.c +++ b/src/add_image.c @@ -191,14 +191,8 @@ wimlib_add_image_multisource(WIMStruct *wim, return 0; out_delete_image: - /* Unsuccessful; rollback the WIM to its original state. */ - - /* wimlib_update_image() is now all-or-nothing, so no dentries remain - * and there's no need to pass the lookup table here. */ - put_image_metadata(wim->image_metadata[wim->hdr.image_count - 1], NULL); - - xml_delete_image(&wim->wim_info, wim->hdr.image_count); - wim->hdr.image_count--; + /* Unsuccessful; rollback by removing the new image. */ + delete_wim_image(wim, wim->hdr.image_count); return ret; }