From: Mark Michelson Date: Thu, 6 Mar 2014 15:43:43 +0000 (+0000) Subject: Don't attempt to link in an aggregate MWI subscription if an endpoint does not aggreg... X-Git-Tag: 12.2.0-rc1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ac921edc3f78a0ebf5084b205255c21372ff6df;p=thirdparty%2Fasterisk.git Don't attempt to link in an aggregate MWI subscription if an endpoint does not aggregate MWI. Attempting to link a NULL object into an ao2 container had been benign previously, but since enabling DO_CRASH in the testsuite, this is now causing a crash. It's better to be right here anyway. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410011 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c index 4a664c8beb..6856a70018 100644 --- a/res/res_pjsip_mwi.c +++ b/res/res_pjsip_mwi.c @@ -755,7 +755,9 @@ static int create_mwi_subscriptions_for_endpoint(void *obj, void *arg, int flags ao2_cleanup(sub); } } - ao2_link(mwi_subscriptions, aggregate_sub); + if (aggregate_sub) { + ao2_link(mwi_subscriptions, aggregate_sub); + } return 0; }