fix memory leak

pull/81/head
Richard Fuchs 11 years ago
parent c2ff5c3fd3
commit b586fa7031

@ -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);
}

@ -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);

Loading…
Cancel
Save