summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-08-23 22:12:57 +0000
committerMatthew Jordan <mjordan@digium.com>2013-08-23 22:12:57 +0000
commitf4bf1823e9e7a3ac87d89b09f86f6b6a621ca433 (patch)
tree84efd48f1e0f93d5ceaaf93e9e63e45744c95dff /main/pbx.c
parent00d8ef8c7955379d02bfe75e005a87072bc3dc65 (diff)
Fix channel reference leak in Originated channels
When originating channels, ast_pbx_outgoing_* caused the dialed channel reference to be bumped twice. Ostensibly, this routine is bumping the channel lifetime such that the channel doesn't get nuked in between locks/unlocks; however, since the routine should return the dialed channel with its reference bumped, it only needs to do this one time. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 27a586ef9..0b970bb13 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -10101,8 +10101,7 @@ static int pbx_outgoing_attempt(const char *type, struct ast_format_cap *cap, co
/* Wait for dialing to complete */
if (channel || synchronous) {
- if (channel) {
- ast_channel_ref(*channel);
+ if (channel && *channel) {
ast_channel_unlock(*channel);
}
while (!outgoing->dialed) {