From: Eric Biggers Date: Mon, 19 Oct 2015 00:39:29 +0000 (-0500) Subject: xml_export_image(): fix memory leak if append_image_node() fails X-Git-Tag: v1.8.3~47 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=871910d3159f6bbbe2981db833c727cb96f16c61 xml_export_image(): fix memory leak if append_image_node() fails --- diff --git a/src/xml.c b/src/xml.c index a6dab415..baf51941 100644 --- a/src/xml.c +++ b/src/xml.c @@ -809,7 +809,10 @@ xml_export_image(const struct wim_xml_info *src_info, int src_image, xmlFreeProp(unlink_index_attribute(dest_node)); - return append_image_node(dest_info, dest_node); + ret = append_image_node(dest_info, dest_node); + if (ret) + goto err; + return 0; err: xmlFreeNode(dest_node);