From: Maxim Dounin Date: Wed, 4 Sep 2013 17:17:00 +0000 (+0400) Subject: Request cleanup code unified, no functional changes. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=4b189002af160515fdd523b3d1802c050268c45f;p=nginx.git Request cleanup code unified, no functional changes. Additionally, detaching a cleanup chain from a request is a bit more resilent to various bugs if any. --- diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 5887376d4..37efb2a52 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -3343,10 +3343,15 @@ ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc) return; } - for (cln = r->cleanup; cln; cln = cln->next) { + cln = r->cleanup; + r->cleanup = NULL; + + while (cln) { if (cln->handler) { cln->handler(cln->data); } + + cln = cln->next; } #if (NGX_STAT_STUB)