From 1eb2ca9f471909bae931aa09b257ac0dd41a30f5 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 21 Feb 2023 15:39:44 +0100 Subject: [PATCH] relaxng: Remove useless if statement ctxt and define are non-NULL at this point. Fixes #482. --- relaxng.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/relaxng.c b/relaxng.c index a72c715e..acf536a5 100644 --- a/relaxng.c +++ b/relaxng.c @@ -7987,12 +7987,7 @@ xmlRelaxNGValidateCompiledCallback(xmlRegExecCtxtPtr exec ATTRIBUTE_UNUSED, ctxt->errNo = XML_RELAXNG_ERR_INTERNAL; return; } - if ((ctxt == NULL) || (define == NULL)) { - fprintf(stderr, "callback on %s missing info\n", token); - if ((ctxt != NULL) && (ctxt->errNo == XML_RELAXNG_OK)) - ctxt->errNo = XML_RELAXNG_ERR_INTERNAL; - return; - } else if (define->type != XML_RELAXNG_ELEMENT) { + if (define->type != XML_RELAXNG_ELEMENT) { fprintf(stderr, "callback on %s define is not element\n", token); if (ctxt->errNo == XML_RELAXNG_OK) ctxt->errNo = XML_RELAXNG_ERR_INTERNAL;