[njs] Modules: removed dead code left after dfcbfb5e27b2.

Dmitry Volyntsev xeioex at nginx.com
Wed Dec 15 13:14:39 UTC 2021


details:   https://hg.nginx.org/njs/rev/659995ad4f97
branches:  
changeset: 1767:659995ad4f97
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Dec 14 20:14:23 2021 +0000
description:
Modules: removed dead code left after dfcbfb5e27b2.

Found by Coverity (CID 1495259).

diffstat:

 nginx/ngx_http_js_module.c   |  6 ------
 nginx/ngx_stream_js_module.c |  6 ------
 2 files changed, 0 insertions(+), 12 deletions(-)

diffs (60 lines):

diff -r ee500f43e2a2 -r 659995ad4f97 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Tue Dec 14 20:06:23 2021 +0000
+++ b/nginx/ngx_http_js_module.c	Tue Dec 14 20:14:23 2021 +0000
@@ -3469,7 +3469,6 @@ ngx_http_js_init_main_conf(ngx_conf_t *c
 
     size_t                 size;
     u_char                *start, *end, *p;
-    ngx_fd_t               fd;
     ngx_str_t             *m, file;
     njs_int_t              rc;
     njs_str_t              text, path;
@@ -3488,7 +3487,6 @@ ngx_http_js_init_main_conf(ngx_conf_t *c
     }
 
     size = 0;
-    fd = NGX_INVALID_FILE;
 
     import = jmcf->imports->elts;
     for (i = 0; i < jmcf->imports->nelts; i++) {
@@ -3498,10 +3496,6 @@ ngx_http_js_init_main_conf(ngx_conf_t *c
 
     start = ngx_pnalloc(cf->pool, size);
     if (start == NULL) {
-        if (fd != NGX_INVALID_FILE) {
-            (void) ngx_close_file(fd);
-        }
-
         return NGX_CONF_ERROR;
     }
 
diff -r ee500f43e2a2 -r 659995ad4f97 nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Tue Dec 14 20:06:23 2021 +0000
+++ b/nginx/ngx_stream_js_module.c	Tue Dec 14 20:14:23 2021 +0000
@@ -1491,7 +1491,6 @@ ngx_stream_js_init_main_conf(ngx_conf_t 
 
     size_t                   size;
     u_char                  *start, *end, *p;
-    ngx_fd_t                 fd;
     ngx_str_t               *m, file;
     njs_int_t                rc;
     njs_str_t                text, path;
@@ -1510,7 +1509,6 @@ ngx_stream_js_init_main_conf(ngx_conf_t 
     }
 
     size = 0;
-    fd = NGX_INVALID_FILE;
 
     import = jmcf->imports->elts;
     for (i = 0; i < jmcf->imports->nelts; i++) {
@@ -1520,10 +1518,6 @@ ngx_stream_js_init_main_conf(ngx_conf_t 
 
     start = ngx_pnalloc(cf->pool, size);
     if (start == NULL) {
-        if (fd != NGX_INVALID_FILE) {
-            (void) ngx_close_file(fd);
-        }
-
         return NGX_CONF_ERROR;
     }
 


More information about the nginx-devel mailing list