From: Richard W.M. Jones Date: Fri, 28 Jan 2011 17:11:40 +0000 (+0000) Subject: lib: Fix use-after-free bug in XPath parsing code. X-Git-Tag: 1.9.7~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=82f5fdb0dbbc0c7b04861edeadf70c86c9342df2;p=libguestfs.git lib: Fix use-after-free bug in XPath parsing code. --- diff --git a/src/virt.c b/src/virt.c index 2c6be3c..9f84908 100644 --- a/src/virt.c +++ b/src/virt.c @@ -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;