Skip to content

Commit

Permalink
Merge pull request #63 from 0x42/fix_setup_dh_double_free
Browse files Browse the repository at this point in the history
Fix double free in setup_dh()
  • Loading branch information
alexeyshch committed Jan 18, 2024
2 parents ae5f748 + da16622 commit 4961c06
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions c_src/fast_tls.c
Expand Up @@ -415,6 +415,7 @@ static int setup_dh(SSL_CTX *ctx, const unsigned char *dh_der, size_t dh_size, c
if (EVP_PKEY_fromdata_init(pctx) <= 0 ||
EVP_PKEY_fromdata(pctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params) <= 0) {
EVP_PKEY_CTX_free(pctx);
return 0;
}
if (SSL_CTX_set0_tmp_dh_pkey(ctx, pkey) != 1) {
EVP_PKEY_free(pkey);
Expand Down

0 comments on commit 4961c06

Please sign in to comment.