]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7425: #resolve dhparams might not be present, causing a seg. Make sure they are...
authorMichael Jerris <mike@jerris.com>
Mon, 4 May 2015 15:23:33 +0000 (11:23 -0400)
committerMichael Jerris <mike@jerris.com>
Mon, 4 May 2015 15:23:33 +0000 (11:23 -0400)
src/switch_rtp.c

index 81f98585fccf94bb2b5732a1a785ae808064f685..0416d153d3175f9fda367ce3f412a70e2547fcdc 100644 (file)
@@ -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);