s/@ctxt check/checks/
On Thu, Mar 07, 2019 at 11:25:18AM -0500, John Ferlan wrote:
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(a)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;
Both now and at the point of its introduction in:
commit e9377dda367b847b5a15dac1403bcdf19f05438a
Multiple security drivers in XML data
def is dereferenced right before its only caller
so you can delete the whole condition.
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano