summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-03-16 14:07:55 +0000
committerJoshua Colp <jcolp@digium.com>2017-03-16 08:09:08 -0600
commit11e806abbb00ba2d61ba0c517c9ae0b40c708c8f (patch)
treedb60b144c326665c3f53f0effbc7113c2453f0a0
parenta07015cd4d13885a0226c045926feae45afabf95 (diff)
res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped.
This change removes an assumption that when DTLS is stopped an RTCP session will be present on the RTP session. This is not always the case. ASTERISK-26732 Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611
-rw-r--r--res/res_rtp_asterisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 76fcde5eb..007506de1 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1577,7 +1577,7 @@ static int ast_rtp_dtls_active(struct ast_rtp_instance *instance)
static void ast_rtp_dtls_stop(struct ast_rtp_instance *instance)
{
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
- int rtcp_dtls_unique = (rtp->dtls.ssl != rtp->rtcp->dtls.ssl);
+ SSL *ssl = rtp->dtls.ssl;
dtls_srtp_stop_timeout_timer(instance, rtp, 0);
@@ -1595,7 +1595,7 @@ static void ast_rtp_dtls_stop(struct ast_rtp_instance *instance)
if (rtp->rtcp) {
dtls_srtp_stop_timeout_timer(instance, rtp, 1);
- if (rtp->rtcp->dtls.ssl && rtcp_dtls_unique) {
+ if (rtp->rtcp->dtls.ssl && (rtp->rtcp->dtls.ssl != ssl)) {
SSL_free(rtp->rtcp->dtls.ssl);
rtp->rtcp->dtls.ssl = NULL;
ast_mutex_destroy(&rtp->rtcp->dtls.lock);