diff src/http/modules/ngx_http_geo_module.c @ 424:9da1d9d94d18 NGINX_0_7_24

nginx 0.7.24 *) Feature: the "if_modified_since" directive. *) Bugfix: nginx did not process a FastCGI server response, if the server send too many messages to stderr before response. *) Bugfix: the "$cookie_..." variables did not work in the SSI and the perl module.
author Igor Sysoev <http://sysoev.ru>
date Mon, 01 Dec 2008 00:00:00 +0300
parents 88d3e895bdf9
children e7dbea1ee115
line wrap: on
line diff
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -255,6 +255,13 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_c
         }
 
     } else {
+        if (ctx.tree == NULL) {
+            ctx.tree = ngx_radix_tree_create(cf->pool, -1);
+            if (ctx.tree == NULL) {
+                return NGX_CONF_ERROR;
+            }
+        }
+
         var->get_handler = ngx_http_geo_cidr_variable;
         var->data = (uintptr_t) ctx.tree;