Skip to content

Commit

Permalink
bugfix: fix a possible resource leak of fd when exception occur (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
shihai1991 committed Sep 3, 2021
1 parent 45c28ad commit 6753cc7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ngx_http_set_secure_random.c
Expand Up @@ -71,6 +71,7 @@ ngx_http_set_misc_set_secure_random_common(int alphabet_type,
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"set_secure_random: could not read all %i byte(s) from "
"/dev/urandom", length);
ngx_close_file(fd);
return NGX_ERROR;
}

Expand Down

0 comments on commit 6753cc7

Please sign in to comment.