changeset 2910:dc01b26f8de8

leave chain in consistent state on errors
author Igor Sysoev <igor@sysoev.ru>
date Tue, 02 Jun 2009 16:07:13 +0000
parents 3f287b615408
children 32b444fa2ca4
files src/core/ngx_output_chain.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -314,12 +314,11 @@ ngx_output_chain_add_copy(ngx_pool_t *po
 
 #endif
 
+        cl->next = NULL;
         *ll = cl;
         ll = &cl->next;
     }
 
-    *ll = NULL;
-
     return NGX_OK;
 }