Skip to content

Commit 07e11f3

Browse files
nandskyzhuizhuhaomeng
authored andcommitted
SSL: fixed potential leak on memory allocation errors.
similar to https://hg.nginx.org/nginx/rev/8981dbb12254 If ngx_pool_cleanup_add() fails, we have to clean just created SSL context manually, thus appropriate call added.
1 parent 7c60431 commit 07e11f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ngx_http_lua_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,7 @@ ngx_http_lua_set_ssl(ngx_conf_t *cf, ngx_http_lua_loc_conf_t *llcf)
14851485

14861486
cln = ngx_pool_cleanup_add(cf->pool, 0);
14871487
if (cln == NULL) {
1488+
ngx_ssl_cleanup_ctx(llcf->ssl);
14881489
return NGX_ERROR;
14891490
}
14901491

0 commit comments

Comments
 (0)