Commit 066b148a authored by François Grisez's avatar François Grisez

Fixes invalid read when stopping an ZRTP call

parent a82861ea
......@@ -664,7 +664,7 @@ int ms_zrtp_channel_start(MSZrtpContext *ctx) {
void ms_zrtp_context_destroy(MSZrtpContext *ctx) {
ms_message("Stopping ZRTP context on session [%p]", ctx->stream_sessions->rtp_session);
ms_message("Stopping ZRTP context on session [%p]", ctx->stream_sessions ? ctx->stream_sessions->rtp_session : NULL);
if (bzrtp_destroyBzrtpContext(ctx->zrtpContext, ctx->self_ssrc) == 0) {
/* we have destroyed the last channel in this zrtp session, free the zidCache context if it exists */
if (ctx->zidCacheContext != NULL) {
......
......@@ -86,6 +86,13 @@ static void audio_stream_free(AudioStream *stream) {
if (stream->outbound_mixer) ms_filter_destroy(stream->outbound_mixer);
if (stream->recorder_file) ms_free(stream->recorder_file);
if (stream->rtp_io_session) rtp_session_destroy(stream->rtp_io_session);
if (stream->ms.sessions.zrtp_context != NULL) {
ms_zrtp_set_stream_sessions(stream->ms.sessions.zrtp_context, NULL);
}
if (stream->ms.sessions.dtls_context != NULL) {
ms_dtls_srtp_set_stream_sessions(stream->ms.sessions.dtls_context, NULL);
}
ms_free(stream);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment