X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fadd_image.c;h=86ba9f0b3d277ede7bb588ba2baf57e754783907;hb=d2def9adabc7282e944ed890f9189c8a850a274a;hp=0aed1deb3a11d5ce2bd868783b641f32f8672742;hpb=4c73e29d8d74a4e969782d2d40e209337414034c;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; }