[njs] Removed unnecessary NULL checks introduced in 0a2a0b5a74f4.

Alexander Borisov alexander.borisov at nginx.com
Thu May 6 13:18:37 UTC 2021


details:   https://hg.nginx.org/njs/rev/c1829352e49c
branches:  
changeset: 1635:c1829352e49c
user:      Alexander Borisov <alexander.borisov at nginx.com>
date:      Thu May 06 16:07:08 2021 +0300
description:
Removed unnecessary NULL checks introduced in 0a2a0b5a74f4.

Found by Coverity (CID 1478004).

diffstat:

 src/njs_parser.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5563f2cbce5b -r c1829352e49c src/njs_parser.c
--- a/src/njs_parser.c	Thu May 06 16:07:06 2021 +0300
+++ b/src/njs_parser.c	Thu May 06 16:07:08 2021 +0300
@@ -7827,7 +7827,7 @@ njs_parser_reference(njs_parser_t *parse
             scope = njs_function_scope(scope->parent);
         }
 
-        if (scope == NULL || scope->type == NJS_SCOPE_GLOBAL) {
+        if (scope->type == NJS_SCOPE_GLOBAL) {
             njs_parser_syntax_error(parser, "\"%V\" object in global scope",
                                     &token->text);
             return NULL;


More information about the nginx-devel mailing list