Mercurial > hg > nginx-vendor-current
diff src/http/modules/ngx_http_image_filter_module.c @ 490:e66f886a8305 NGINX_0_7_57
nginx 0.7.57
*) Bugfix: a segmentation fault occurred in worker process, if the
ngx_http_image_filter_module errors were redirected to named
location; the bug had appeared in 0.7.56.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 12 May 2009 00:00:00 +0400 |
parents | 829f9a66a659 |
children | 98143f74eb3d |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_image_filter_module.c +++ b/src/http/modules/ngx_http_image_filter_module.c @@ -162,6 +162,13 @@ ngx_http_image_header_filter(ngx_http_re return ngx_http_next_header_filter(r); } + ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module); + + if (ctx) { + ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module); + return ngx_http_next_header_filter(r); + } + conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module); if (conf->filter == NGX_HTTP_IMAGE_OFF) { @@ -181,13 +188,6 @@ ngx_http_image_header_filter(ngx_http_re return NGX_ERROR; } - ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module); - - if (ctx) { - ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module); - return ngx_http_next_header_filter(r); - } - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t)); if (ctx == NULL) { return NGX_ERROR;