]> git.kaiwu.me - nginx.git/commitdiff
fix case when regex locaiton runs the second time via internal redirect
authorIgor Sysoev <igor@sysoev.ru>
Sat, 14 Mar 2009 19:24:17 +0000 (19:24 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 14 Mar 2009 19:24:17 +0000 (19:24 +0000)
src/http/ngx_http_core_module.c

index 2d4feab75b0319e7e2df4440a496b63ede2ae15f..66698d5259922bb9dbd5d5553670bc2b0df0096d 100644 (file)
@@ -1378,13 +1378,15 @@ ngx_http_core_find_location(ngx_http_request_t *r)
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                            "test location: ~ \"%V\"", &(*clcfp)->name);
 
-            if ((*clcfp)->captures && r->captures == NULL) {
+            if ((*clcfp)->captures) {
 
                 len = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
 
-                r->captures = ngx_palloc(r->pool, len * sizeof(int));
                 if (r->captures == NULL) {
-                    return NGX_ERROR;
+                    r->captures = ngx_palloc(r->pool, len * sizeof(int));
+                    if (r->captures == NULL) {
+                        return NGX_ERROR;
+                    }
                 }
             }