summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-08-03 18:27:56 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-08-03 18:27:56 +0000
commita999586594747e855ab5fe7299eba6177cd15656 (patch)
treebf0f3ad1041cd7fd24205dda6d21aef4bb830e8a /src
parent6dd6aefaa7bfef189facce4c5f2866c45d5897fc (diff)
downloadnginx-a999586594747e855ab5fe7299eba6177cd15656.tar.gz
nginx-a999586594747e855ab5fe7299eba6177cd15656.tar.bz2
fix segfault, the bug has been introduced in r3738
Diffstat (limited to '')
-rw-r--r--src/http/modules/ngx_http_geoip_module.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_geoip_module.c b/src/http/modules/ngx_http_geoip_module.c
index e248d01b0..51e20e751 100644
--- a/src/http/modules/ngx_http_geoip_module.c
+++ b/src/http/modules/ngx_http_geoip_module.c
@@ -274,6 +274,9 @@ ngx_http_geoip_region_name_variable(ngx_http_request_t *r,
}
val = GeoIP_region_name_by_code(gr->country_code, gr->region);
+ if (val == NULL) {
+ goto no_value;
+ }
len = ngx_strlen(val);
v->data = ngx_pnalloc(r->pool, len);
@@ -294,6 +297,10 @@ ngx_http_geoip_region_name_variable(ngx_http_request_t *r,
return NGX_OK;
+no_value:
+
+ GeoIPRecord_delete(gr);
+
not_found:
v->not_found = 1;