提交 bf72ee04 编写于 作者: J John Ferlan

conf: Remove unnecessary checks in virSecurityLabelDefsParseXML

Failure would have occurred for @ctxt before in callers' other
virXPath calls and @def derefs.

Found by Coverity due to commit 66a508d2 using VIR_XPATH_NODE_AUTORESTORE
to access @ctxt before the if condition. The @def was noted by review.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 14b6a185
......@@ -8516,10 +8516,6 @@ virSecurityLabelDefsParseXML(virDomainDefPtr def,
virCapsHostPtr host = &caps->host;
VIR_AUTOFREE(xmlNodePtr *) list = NULL;
/* Check args and save context */
if (def == NULL || ctxt == NULL)
return 0;
/* Allocate a security labels based on XML */
if ((n = virXPathNodeSet("./seclabel", ctxt, &list)) < 0)
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册