Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path" into 13

This commit is contained in:
Joshua Colp
2016-05-19 05:12:46 -05:00
committed by Gerrit Code Review

View File

@@ -687,8 +687,15 @@ static int explicit_publish_destroy(void *data)
{ {
struct ast_sip_outbound_publish_client *client = data; struct ast_sip_outbound_publish_client *client = data;
/*
* 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); pjsip_publishc_destroy(client->client);
ao2_ref(client, -1); ao2_ref(client, -1);
}
return 0; return 0;
} }