changeset 7282:da9941c9b01b

Leave chain in ngx_chain_add_copy() in consistent state on errors.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 04 Jun 2018 18:47:54 +0300
parents bd6563e81cea
children d0b897c0bb5b
files src/core/ngx_buf.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }