[svn-commits] mjordan: trunk r402942 - in /trunk: ./ res/res_pjsip_mwi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 21 11:53:23 CST 2013


Author: mjordan
Date: Thu Nov 21 11:53:22 2013
New Revision: 402942

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402942
Log:
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

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_mwi.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Thu Nov 21 11:53:22 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-402738,402755,402757,402767,402769,402787,402793,402804,402817,402838,402864,402891,402926
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-402738,402755,402757,402767,402769,402787,402793,402804,402817,402838,402864,402891,402926,402940

Modified: trunk/res/res_pjsip_mwi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_mwi.c?view=diff&rev=402942&r1=402941&r2=402942
==============================================================================
--- trunk/res/res_pjsip_mwi.c (original)
+++ trunk/res/res_pjsip_mwi.c Thu Nov 21 11:53:22 2013
@@ -682,6 +682,7 @@
 	}
 	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)




More information about the svn-commits mailing list