summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-05-11 12:56:52 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-05-11 12:56:52 -0500
commitce3733d16e4a2e24948ad698f72cc213f9e4be46 (patch)
tree1b54a75b8066349d23fb6b04c16580eb57d791ca
parent87787bb889bb4500b7305c089819dd22c46efdfc (diff)
parentdfbb03cc8e1d284b50805be8dfd6eb5595172143 (diff)
Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path"
-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 0265c424e..ed06a33d1 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -701,8 +701,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;
}