Merge "res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying."

This commit is contained in:
zuul 2016-05-25 08:38:22 -05:00 committed by Gerrit Code Review
commit a6b16d7029
1 changed files with 5 additions and 1 deletions

View File

@ -1125,6 +1125,8 @@ static int explicit_publish_destroy(void *data)
ao2_ref(publisher, -1);
}
ao2_ref(publisher, -1);
return 0;
}
@ -1140,7 +1142,9 @@ static int cancel_and_unpublish(void *obj, void *arg, int flags)
/* If the publisher was never started, there's nothing to unpublish, so just
* destroy the publication and remove its reference to the publisher.
*/
ast_sip_push_task(NULL, explicit_publish_destroy, publisher);
if (ast_sip_push_task(NULL, explicit_publish_destroy, ao2_bump(publisher))) {
ao2_ref(publisher, -1);
}
return 0;
}