diff --git a/daemon/call.c b/daemon/call.c index 1436f61a9..041128100 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2949,6 +2949,8 @@ static void __call_free(void *p) { g_slice_free1(sizeof(*em), em); } g_hash_table_destroy(md->rtp_payload_types); + crypto_params_cleanup(&md->sdes_in.params); + crypto_params_cleanup(&md->sdes_out.params); g_slice_free1(sizeof(*md), md); } g_queue_clear(&m->medias); @@ -2962,6 +2964,7 @@ static void __call_free(void *p) { ps = c->streams->data; c->streams = g_slist_delete_link(c->streams, c->streams); g_hash_table_destroy(ps->rtp_stats); + crypto_cleanup(&ps->crypto); g_slice_free1(sizeof(*ps), ps); } diff --git a/daemon/crypto.h b/daemon/crypto.h index b652a72cb..82e02dd47 100644 --- a/daemon/crypto.h +++ b/daemon/crypto.h @@ -127,12 +127,13 @@ INLINE void crypto_params_cleanup(struct crypto_params *p) { p->mki = NULL; } INLINE void crypto_cleanup(struct crypto_context *c) { + crypto_params_cleanup(&c->params); if (!c->params.crypto_suite) return; if (c->params.crypto_suite->session_key_cleanup) c->params.crypto_suite->session_key_cleanup(c); c->have_session_key = 0; - crypto_params_cleanup(&c->params); + c->params.crypto_suite = NULL; } INLINE void crypto_reset(struct crypto_context *c) { crypto_cleanup(c);