Merge pull request #21 from bnchdan/close-file

close file
This commit is contained in:
2022-11-21 21:52:38 -05:00
committed by GitHub

View File

@@ -169,11 +169,13 @@ static char *ngx_http_js_challenge_merge_loc_conf(ngx_conf_t *cf, void *parent,
if (fd < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not open file '%s': %s", path,
strerror(errno));
close(fd);
return NGX_CONF_ERROR;
}
conf->html = ngx_palloc(cf->pool, info.st_size);
int ret = read(fd, conf->html, info.st_size);
close(fd);
if (ret < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not read file '%s': %s", path,
strerror(errno));