Skip to content
Snippets Groups Projects
Commit 08686e62 authored by Matthew Jordan's avatar Matthew Jordan
Browse files

res_pjsip_mwi: Fix memory leak of MWI subscriptions container

This patch fixes a reference counting memory leak on the ao2_container
created as part of create_mwi_subscriptions. When we create the container
in this routine, the intent is to hand lifetime ownership over to the global
container unsolicited_mwi. When ao2_global_obj_replace_unref is called, the
reference count on mwi_subscriptions (the container) will be bumped by 1;
however, the function does not decrement the reference count on
mwi_subscriptions when this occurs. This will prevent the container from being
fully disposed of when Asterisk exits (or on any subsequent call to this
operation, such as during a reload).
........

Merged revisions 402940 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent f0ccc59a
No related branches found
No related tags found
No related merge requests found
......@@ -682,6 +682,7 @@ static void create_mwi_subscriptions(void)
}
ao2_callback(endpoints, OBJ_NODATA, create_mwi_subscriptions_for_endpoint, mwi_subscriptions);
ao2_global_obj_replace_unref(unsolicited_mwi, mwi_subscriptions);
ao2_ref(mwi_subscriptions, -1);
}
static int reload(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment