]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Remove unnecessary checks in virSecurityLabelDefsParseXML
authorJohn Ferlan <jferlan@redhat.com>
Thu, 7 Mar 2019 16:06:28 +0000 (11:06 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 7 Mar 2019 17:04:58 +0000 (12:04 -0500)
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>
src/conf/domain_conf.c

index eb660f5764fa9257abb9a6ec917047a15cdb4499..2a9ae22844840a598cccefff38d5bddcf7ddd0ae 100644 (file)
@@ -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;