Commit 029e0174 authored by Matthew Waters's avatar Matthew Waters

srtp: zero out session member on dealloc

Fixes a user-after-free retrieving stats from _get_property()
parent 63dd27a7
......@@ -777,8 +777,10 @@ gst_srtp_dec_clear_streams (GstSrtpDec * filter)
GST_OBJECT_LOCK (filter);
if (!filter->first_session)
if (!filter->first_session) {
srtp_dealloc (filter->session);
filter->session = NULL;
}
if (filter->streams)
nb = g_hash_table_foreach_remove (filter->streams, remove_yes, NULL);
......
......@@ -447,8 +447,10 @@ gst_srtp_enc_create_session (GstSrtpEnc * filter)
static void
gst_srtp_enc_reset_no_lock (GstSrtpEnc * filter)
{
if (!filter->first_session)
if (!filter->first_session) {
srtp_dealloc (filter->session);
filter->session = NULL;
}
filter->first_session = TRUE;
filter->key_changed = FALSE;
......
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