mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
14b6a1854f
commit
bf72ee049e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user