From 1b322bd952c814c63c2c151f7ad62e74d45afa66 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 4 May 2015 11:23:33 -0400 Subject: [PATCH] FS-7425: #resolve dhparams might not be present, causing a seg. Make sure they are there before we apply them --- src/switch_rtp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 81f98585fc..0416d153d3 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3127,8 +3127,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d bio = BIO_new_file(dtls->pem, "r"); dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); BIO_free(bio); - SSL_CTX_set_tmp_dh(dtls->ssl_ctx, dh); - DH_free(dh); + if (dh) { + SSL_CTX_set_tmp_dh(dtls->ssl_ctx, dh); + DH_free(dh); + } SSL_CTX_set_mode(dtls->ssl_ctx, SSL_MODE_AUTO_RETRY);