Skip to content

Commit 56c62ef

Browse files
committed
Correctly use APi as pointed out by remm.
1 parent bba9e94 commit 56c62ef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

native/src/sslcontext.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,9 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, setCertificate)(TCN_STDARGS, jlong ctx,
10321032
/* XXX Does this also work for pkcs12 or only for PEM files?
10331033
* If only for PEM files move above to the PEM handling */
10341034
if ((idx == 0) && (evp = SSL_dh_GetParamFromFile(cert_file))) {
1035-
SSL_CTX_set0_tmp_dh_pkey(c->ctx, evp);
1036-
EVP_PKEY_free(evp);
1035+
if (!SSL_CTX_set0_tmp_dh_pkey(c->ctx, evp)) {
1036+
EVP_PKEY_free(evp);
1037+
}
10371038
}
10381039

10391040
#ifdef HAVE_ECC

0 commit comments

Comments
 (0)