diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-03-06 15:58:13 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-03-06 15:58:13 +0000 |
commit | 59ff66ef0275ff9985a3cd3168fc797cf152b38e (patch) | |
tree | 2b71fc7e2a1e4215c457ae7975b28f3675599fbe /res/res_pjsip_mwi.c | |
parent | 0a4dd1481ab038003f1acb0322e2314a2fb4420c (diff) |
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.
........
Merged revisions 410011 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_mwi.c')
-rw-r--r-- | res/res_pjsip_mwi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c index 4a664c8be..6856a7001 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; } |