xml_export_image(): fix memory leak if append_image_node() fails
authorEric Biggers <ebiggers3@gmail.com>
Mon, 19 Oct 2015 00:39:29 +0000 (19:39 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 19 Oct 2015 00:48:25 +0000 (19:48 -0500)
src/xml.c

index a6dab41..baf5194 100644 (file)
--- 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);