diff options
author | Corey Farrell <git@cfware.com> | 2017-10-27 14:41:15 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-10-27 14:50:14 -0400 |
commit | 099187443080d6cf3a652dfc736fd9eda044fcc1 (patch) | |
tree | b5b633d759a4ac5e4ed14b335a36d5100dca3959 /res/res_pjsip_pubsub.c | |
parent | 2a898460db8d3d9c48c1e96e1f96f64ce9370fec (diff) |
res_pjsip_pubsub: Resolve potential crash in allocate_subscription.
When allocate_subscription fails to initialize fields of the new sub it
calls destroy_subscription.
Change-Id: I5b79c915ec216dc00c13c1e4172137864a4bec85
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r-- | res/res_pjsip_pubsub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index a1bfbb71f..62b187951 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -1089,7 +1089,7 @@ static void remove_subscription(struct sip_subscription_tree *obj) static void destroy_subscription(struct ast_sip_subscription *sub) { ast_debug(3, "Destroying SIP subscription from '%s->%s'\n", - sub->tree->endpoint ? ast_sorcery_object_get_id(sub->tree->endpoint) : "Unknown", + sub->tree && sub->tree->endpoint ? ast_sorcery_object_get_id(sub->tree->endpoint) : "Unknown", sub->resource); ast_free(sub->body_text); |