From: John Ferlan Date: Thu, 7 Mar 2019 16:06:28 +0000 (-0500) Subject: conf: Remove unnecessary checks in virSecurityLabelDefsParseXML X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bf72ee049e92fc5b7d123971c7f6f1afecc38a41;p=libvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index eb660f5764..2a9ae22844 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;