# HG changeset patch # User Igor Sysoev # Date 1185093639 0 # Node ID ccd8734e4a8090fd2338422a6ccbaafc460ec0ad # Parent 8b34fbcd93938a2c4da3f1bb554fa4e44ba5e713 r1318, r1319, r1320, r1321 merge: fix various bugs found by Coverity's Scan diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -438,6 +438,9 @@ ngx_set_environment(ngx_cycle_t *cycle, } var = ngx_array_push(&ccf->env); + if (var == NULL) { + return NULL; + } var->len = 2; var->data = (u_char *) "TZ"; diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -456,6 +456,9 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_s } ctx->data = data; + + } else { + data = NULL; } for ( ;; ) { @@ -581,8 +584,8 @@ done: ngx_free(buf.data); } - if (ctx->alloc) { - ngx_free(ctx->data); + if (data) { + ngx_free(data); ctx->data = prev; } diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -163,6 +163,7 @@ ngx_palloc(ngx_pool_t *pool, size_t size large = ngx_palloc(pool, sizeof(ngx_pool_large_t)); if (large == NULL) { + ngx_free(p); return NULL; } diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -439,6 +439,8 @@ ngx_http_ssi_body_filter(ngx_http_reques if (rc == NGX_ERROR || rc == NGX_AGAIN) { return rc; } + + break; } }