summaryrefslogtreecommitdiffstats
path: root/tcpd
diff options
context:
space:
mode:
Diffstat (limited to 'tcpd')
-rw-r--r--tcpd/libcouriertls.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tcpd/libcouriertls.c b/tcpd/libcouriertls.c
index 22b9593..44ba121 100644
--- a/tcpd/libcouriertls.c
+++ b/tcpd/libcouriertls.c
@@ -426,10 +426,19 @@ static void load_dh_params(SSL_CTX *ctx, const char *filename,
{
if (EVP_PKEY_is_a(pkey, "DH"))
{
- SSL_CTX_set0_tmp_dh_pkey(ctx, pkey);
- *cert_file_flags = 1;
+ if (SSL_CTX_set0_tmp_dh_pkey(ctx, pkey))
+ {
+ *cert_file_flags = 1;
+ }
+ else
+ {
+ EVP_PKEY_free(pkey);
+ }
+ }
+ else
+ {
+ EVP_PKEY_free(pkey);
}
- EVP_PKEY_free(pkey);
}
#else