lib: Fix use-after-free bug in XPath parsing code.

This commit is contained in:
Richard W.M. Jones
2011-01-28 17:11:40 +00:00
parent d2636b0984
commit 82f5fdb0db

View File

@@ -196,8 +196,8 @@ guestfs___for_each_disk (guestfs_h *g,
assert (xptype->nodesetval->nodeTab[0]);
assert (xptype->nodesetval->nodeTab[0]->type == XML_ATTRIBUTE_NODE);
xmlAttrPtr attr = (xmlAttrPtr) xptype->nodesetval->nodeTab[0];
xmlXPathFreeObject (xptype);
char *type = (char *) xmlNodeListGetString (doc, attr->children, 1);
xmlXPathFreeObject (xptype);
xmlXPathObjectPtr xpfilename;