summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_publish.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-05-19 05:12:46 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-05-19 05:12:46 -0500
commitcceccd68ad4377769b08d278142c80f2afe797b6 (patch)
tree95d02b9f4a9e3b67b03d3c824f7708d3d1cfbaff /res/res_pjsip_outbound_publish.c
parent4509aa890fdcfe3f347bc30f6f6fca6c350b8686 (diff)
parent1b5c91b7be1020754ca724e488c9fb733dbce99d (diff)
Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path" into 13
Diffstat (limited to 'res/res_pjsip_outbound_publish.c')
-rw-r--r--res/res_pjsip_outbound_publish.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 141cdef62..fa10fb26c 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -687,8 +687,15 @@ static int explicit_publish_destroy(void *data)
{
struct ast_sip_outbound_publish_client *client = data;
- pjsip_publishc_destroy(client->client);
- ao2_ref(client, -1);
+ /*
+ * If there is no pjsip publishing client then we obviously don't need
+ * to destroy it. Also, the ref for the Asterisk publishing client that
+ * pjsip had would not exist or should already be gone as well.
+ */
+ if (client->client) {
+ pjsip_publishc_destroy(client->client);
+ ao2_ref(client, -1);
+ }
return 0;
}