summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-07-22 08:40:39 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-07-22 08:40:39 +0000
commitfbd3b2d727af9cc308d0a0c82812d5181f9a477e (patch)
treec53108341baaff39fadf949688064c0080cdc82d /src
parent9aa11666250cbe8a832863d77cb41c128ecfa20c (diff)
downloadnginx-fbd3b2d727af9cc308d0a0c82812d5181f9a477e.tar.gz
nginx-fbd3b2d727af9cc308d0a0c82812d5181f9a477e.tar.bz2
r1318, r1319, r1320, r1321 merge:
fix various bugs found by Coverity's Scan
Diffstat (limited to 'src')
-rw-r--r--src/core/nginx.c3
-rw-r--r--src/core/ngx_file.c7
-rw-r--r--src/core/ngx_palloc.c1
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c2
4 files changed, 11 insertions, 2 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index df6c72cfd..b758775e3 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -438,6 +438,9 @@ ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
}
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
index cef4dc1b8..92c74d699 100644
--- 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_str_t *tree)
}
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
index 2e72a0f3b..978fc30f0 100644
--- 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
index 549ae4ce2..0de03aae0 100644
--- 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_request_t *r, ngx_chain_t *in)
if (rc == NGX_ERROR || rc == NGX_AGAIN) {
return rc;
}
+
+ break;
}
}