mirror of
https://github.com/nginx/nginx.git
synced 2024-11-24 04:49:01 +08:00
fix segfault, the bug has been introduced in r3738
This commit is contained in:
parent
6dd6aefaa7
commit
a999586594
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user