[libvirt] [PATCH] conf: Remove unnecessary @ctxt check in virSecurityLabelDefsParseXML

John Ferlan jferlan at redhat.com
Thu Mar 7 16:25:18 UTC 2019


Failure would have occurred before in callers other virXPath calls.

Found by Coverity due to commit 66a508d2 using VIR_XPATH_NODE_AUTORESTORE
to access @ctxt before the if condition.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/domain_conf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index eb660f5764..dc57b23084 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8516,8 +8516,7 @@ virSecurityLabelDefsParseXML(virDomainDefPtr def,
     virCapsHostPtr host = &caps->host;
     VIR_AUTOFREE(xmlNodePtr *) list = NULL;
 
-    /* Check args and save context */
-    if (def == NULL || ctxt == NULL)
+    if (def == NULL)
         return 0;
 
     /* Allocate a security labels based on XML */
-- 
2.20.1




More information about the libvir-list mailing list