summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/manager.c3
-rw-r--r--main/pbx.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/main/manager.c b/main/manager.c
index 7e5b1080c..ec031303b 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -4329,9 +4329,10 @@ static void *fast_originate(void *data)
S_OR(in->cid_name, "<unknown>")
);
- /* Locked by ast_pbx_outgoing_exten or ast_pbx_outgoing_app */
+ /* Locked and ref'd by ast_pbx_outgoing_exten or ast_pbx_outgoing_app */
if (chan) {
ast_channel_unlock(chan);
+ ast_channel_unref(chan);
}
destroy_fast_originate_helper(in);
return NULL;
diff --git a/main/pbx.c b/main/pbx.c
index db737327f..8079edc62 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -9967,6 +9967,7 @@ static int pbx_outgoing_attempt(const char *type, struct ast_format_cap *cap, co
if (channel) {
*channel = dialed;
+ ast_channel_ref(*channel);
ast_channel_lock(*channel);
}
@@ -9981,6 +9982,7 @@ static int pbx_outgoing_attempt(const char *type, struct ast_format_cap *cap, co
ast_log(LOG_WARNING, "Unable to spawn dialing thread for '%s/%s'\n", type, addr);
if (channel) {
ast_channel_unlock(*channel);
+ ast_channel_unref(*channel);
}
ao2_ref(outgoing, -1);
return -1;