mirror of
https://github.com/simon987/ngx_http_js_challenge_module.git
synced 2025-04-10 14:06:46 +00:00
close file
This commit is contained in:
parent
b1c85a625d
commit
77063f4274
@ -169,11 +169,13 @@ static char *ngx_http_js_challenge_merge_loc_conf(ngx_conf_t *cf, void *parent,
|
|||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not open file '%s': %s", path,
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not open file '%s': %s", path,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
close(fd);
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->html = ngx_palloc(cf->pool, info.st_size);
|
conf->html = ngx_palloc(cf->pool, info.st_size);
|
||||||
int ret = read(fd, conf->html, info.st_size);
|
int ret = read(fd, conf->html, info.st_size);
|
||||||
|
close(fd);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not read file '%s': %s", path,
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not read file '%s': %s", path,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user