summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/res_pjsip_mwi.c4
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;
}