From bf72ee049e92fc5b7d123971c7f6f1afecc38a41 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 7 Mar 2019 11:06:28 -0500 Subject: [PATCH] conf: Remove unnecessary checks in virSecurityLabelDefsParseXML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/conf/domain_conf.c | 4 ---- 1 file changed, 4 deletions(-) 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;