Free DH parameter right after handshake

This commit is contained in:
Bruno Silvestre
2018-07-26 11:21:54 -03:00
parent 953a363a59
commit d9d0cd620d
2 changed files with 9 additions and 19 deletions

View File

@ -384,6 +384,11 @@ static int meth_handshake(lua_State *L)
{
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
int err = handshake(ssl);
p_context ctx = (p_context)SSL_CTX_get_app_data(SSL_get_SSL_CTX(ssl->ssl));
if (ctx->dh_param) {
DH_free(ctx->dh_param);
ctx->dh_param = NULL;
}
if (err == IO_DONE) {
lua_pushboolean(L, 1);
return 1;