Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed two spots where we did not check against null pointers when all…

…ocating memory.
  • Loading branch information...
commit 19e17f08b685d0fa4bf57a029adaf0b199673f61 1 parent 592845e
@agentzh agentzh authored
View
7 src/ngx_http_headers_more_headers_in.c
@@ -431,7 +431,11 @@ ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd,
if (hcf->cmds == NULL) {
hcf->cmds = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_headers_more_cmd_t));
+ sizeof(ngx_http_headers_more_cmd_t));
+
+ if (hcf->cmds == NULL) {
+ return NGX_CONF_ERROR;
+ }
}
cmd = ngx_array_push(hcf->cmds);
@@ -442,6 +446,7 @@ ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd,
cmd->headers = ngx_array_create(cf->pool, 1,
sizeof(ngx_http_headers_more_header_val_t));
+
if (cmd->headers == NULL) {
return NGX_CONF_ERROR;
}
View
6 src/ngx_http_headers_more_headers_out.c
@@ -429,7 +429,11 @@ ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd,
if (hcf->cmds == NULL) {
hcf->cmds = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_headers_more_cmd_t));
+ sizeof(ngx_http_headers_more_cmd_t));
+
+ if (hcf->cmds == NULL) {
+ return NGX_CONF_ERROR;
+ }
}
cmd = ngx_array_push(hcf->cmds);
Please sign in to comment.
Something went wrong with that request. Please try again.