]> git.kaiwu.me - nginx.git/commitdiff
preserve XML wellFormed field before freeing memory
authorIgor Sysoev <igor@sysoev.ru>
Fri, 17 Jul 2009 08:04:52 +0000 (08:04 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 17 Jul 2009 08:04:52 +0000 (08:04 +0000)
src/http/modules/ngx_http_xslt_filter_module.c

index c43747b06d8d24ab9442948a40faf4794f04792d..ca9e15dc64b616e94032c501b8d78a4e9d37da5e 100644 (file)
@@ -247,6 +247,7 @@ ngx_http_xslt_header_filter(ngx_http_request_t *r)
 static ngx_int_t
 ngx_http_xslt_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
 {
+    int                          wellFormed;
     ngx_chain_t                 *cl;
     ngx_http_xslt_filter_ctx_t  *ctx;
 
@@ -288,9 +289,11 @@ ngx_http_xslt_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
             ctx->doc->extSubset = NULL;
 #endif
 
+            wellFormed = ctx->ctxt->wellFormed;
+
             xmlFreeParserCtxt(ctx->ctxt);
 
-            if (ctx->ctxt->wellFormed) {
+            if (wellFormed) {
                 return ngx_http_xslt_send(r, ctx,
                                        ngx_http_xslt_apply_stylesheet(r, ctx));
             }