summaryrefslogtreecommitdiff
path: root/res/res_pjsip_mwi.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-11-21 17:53:22 +0000
committerMatthew Jordan <mjordan@digium.com>2013-11-21 17:53:22 +0000
commit08686e62c5e36fda2e658fa302cdad8ad84a575a (patch)
tree9cc6b60471c7886cccd6e0542fb849dddf60ba88 /res/res_pjsip_mwi.c
parentf0ccc59a22553f47be857a7333914957983bbcb8 (diff)
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
Diffstat (limited to 'res/res_pjsip_mwi.c')
-rw-r--r--res/res_pjsip_mwi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 6bed36392..bd865eec4 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -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)