diff options
author | George Joseph <gjoseph@digium.com> | 2017-06-16 08:31:04 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-06-16 15:08:45 -0500 |
commit | 854a6de819b8c14b7493fde28460eb4f9fb305e3 (patch) | |
tree | 79146c93325459fc3a00f9cbc507c80404cae226 /main/channel.c | |
parent | 0405185357d4d857af7375fa495c6893f943e249 (diff) |
res_stasis: Plug reference leak on stolen channels
When a stasis channel is stolen by another app, the control
structure is unreffed but never unlinked from the app_controls
container. This causes the channel reference to leak.
Added OBJ_UNLINK to the callback in channel_stolen_cb.
Also added some additional channel lifecycle debug messages to
channel.c.
ASTERISK-27059 #close
Repoorted-by: George Joseph
Change-Id: Ib820936cd49453f20156971785e7f4f182c56e14
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index 1ca485e7a..8b4dc75be 100644 --- a/main/channel.c +++ b/main/channel.c @@ -998,6 +998,9 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char * the world know of its existance */ ast_channel_stage_snapshot_done(tmp); + + ast_debug(1, "Channel %p '%s' allocated\n", tmp, ast_channel_name(tmp)); + return tmp; } @@ -2217,6 +2220,8 @@ static void ast_channel_destructor(void *obj) char device_name[AST_CHANNEL_NAME]; ast_callid callid; + ast_debug(1, "Channel %p '%s' destroying\n", chan, ast_channel_name(chan)); + /* Stop monitoring */ if (ast_channel_monitor(chan)) { ast_channel_monitor(chan)->stop(chan, 0); @@ -2579,6 +2584,9 @@ void ast_hangup(struct ast_channel *chan) return; } + ast_debug(1, "Channel %p '%s' hanging up. Refs: %d\n", chan, ast_channel_name(chan), + ao2_ref(chan, 0)); + ast_autoservice_stop(chan); ast_channel_lock(chan); @@ -2638,7 +2646,6 @@ void ast_hangup(struct ast_channel *chan) ast_assert(ast_test_flag(ast_channel_flags(chan), AST_FLAG_BLOCKING) == 0); } - ast_debug(1, "Hanging up channel '%s'\n", ast_channel_name(chan)); if (ast_channel_tech(chan)->hangup) { ast_channel_tech(chan)->hangup(chan); } |