提交 67fbf129 编写于 作者: P Pavel Hrdina

Fix possible memory leak in util/virxml.c

A "xmlstr" string may not be assigned into a "doc" pointer and it
could cause memory leak. To fix it if the "doc" pointer is NULL and
the "xmlstr" string is not assigned we should free it.

This has been found by coverity.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 788e6cb2
......@@ -1047,6 +1047,8 @@ virXMLExtractNamespaceXML(xmlNodePtr root,
cleanup:
if (doc)
*doc = xmlstr;
else
VIR_FREE(xmlstr);
xmlFreeNode(nodeCopy);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册