]> git.kaiwu.me - njs.git/commitdiff
Modules: removed dead code left after dfcbfb5e27b2.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 14 Dec 2021 20:14:23 +0000 (20:14 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 14 Dec 2021 20:14:23 +0000 (20:14 +0000)
Found by Coverity (CID 1495259).

nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c

index 5b20a08442502c83c02fa396ba5a47389de2d634..68592ad21ae1f8ddb3df963a462a9132a1dc100d 100644 (file)
@@ -3469,7 +3469,6 @@ ngx_http_js_init_main_conf(ngx_conf_t *cf, void *conf)
 
     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 *cf, void *conf)
     }
 
     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 *cf, void *conf)
 
     start = ngx_pnalloc(cf->pool, size);
     if (start == NULL) {
-        if (fd != NGX_INVALID_FILE) {
-            (void) ngx_close_file(fd);
-        }
-
         return NGX_CONF_ERROR;
     }
 
index 55e2a6bdb90fcc8457b272d12133e5f47533a6a0..44a7d38e537aecc928ef7bfb9e47585d032acbe3 100644 (file)
@@ -1491,7 +1491,6 @@ ngx_stream_js_init_main_conf(ngx_conf_t *cf, void *conf)
 
     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 *cf, void *conf)
     }
 
     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 *cf, void *conf)
 
     start = ngx_pnalloc(cf->pool, size);
     if (start == NULL) {
-        if (fd != NGX_INVALID_FILE) {
-            (void) ngx_close_file(fd);
-        }
-
         return NGX_CONF_ERROR;
     }