# HG changeset patch # User Sergey Kandaurov # Date 1528127274 -10800 # Node ID da9941c9b01bbc62c67961ca442f8bf1a7f23ce3 # Parent bd6563e81cea2d584960c83b1587f4e35eae6d69 Leave chain in ngx_chain_add_copy() in consistent state on errors. diff --git a/src/core/ngx_buf.c b/src/core/ngx_buf.c --- a/src/core/ngx_buf.c +++ b/src/core/ngx_buf.c @@ -137,6 +137,7 @@ ngx_chain_add_copy(ngx_pool_t *pool, ngx while (in) { cl = ngx_alloc_chain_link(pool); if (cl == NULL) { + *ll = NULL; return NGX_ERROR; }