Skip to content

Commit aef60eb

Browse files
committed
Properly initialize list elements
1 parent 39941d4 commit aef60eb

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/ngx_http_lua_control.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ ngx_http_lua_ngx_redirect(lua_State *L)
280280

281281
h->value.len = len;
282282
h->value.data = uri;
283+
h->next = NULL;
283284
ngx_str_set(&h->key, "Location");
284285

285286
r->headers_out.status = rc;

src/ngx_http_lua_headers_in.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ ngx_http_set_header_helper(ngx_http_request_t *r, ngx_http_lua_header_val_t *hv,
280280

281281
h->key = hv->key;
282282
h->value = *value;
283+
h->next = NULL;
283284

284285
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
285286
if (h->lowcase_key == NULL) {

src/ngx_http_lua_headers_out.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ ngx_http_set_header_helper(ngx_http_request_t *r, ngx_http_lua_header_val_t *hv,
229229

230230
h->key = hv->key;
231231
h->value = *value;
232+
h->next = NULL;
232233

233234
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
234235
if (h->lowcase_key == NULL) {
@@ -444,6 +445,7 @@ ngx_http_set_builtin_multi_header(ngx_http_request_t *r,
444445
}
445446

446447
ho->key = hv->key;
448+
ho->next = NULL;
447449
*ph = ho;
448450

449451
return NGX_OK;

0 commit comments

Comments
 (0)