summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-05-25 08:38:22 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-05-25 08:38:22 -0500
commita6b16d7029a7a44c6a43b3b0f1cbc74cecd11454 (patch)
treea529c4235ae60eb47150cdc30b4a42ecf4d11aa6 /res
parentb0e4ea96de42f0b36845a432937d3c7f6218dd76 (diff)
parent070eab6ed26b1bc287618f0372b8b4489f7479f3 (diff)
Merge "res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying."
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_outbound_publish.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 1c3b0c644..53e15a0a4 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -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;
}