diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index 371ccebfc5..87712cf798 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -1079,6 +1079,10 @@ static void destroy_subscriptions(struct ast_sip_subscription *root) { int i; + if (!root) { + return; + } + for (i = 0; i < AST_VECTOR_SIZE(&root->children); ++i) { struct ast_sip_subscription *child;