diff options
author | Kevin Harwell <kharwell@digium.com> | 2015-02-26 17:07:50 +0000 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2015-02-26 17:07:50 +0000 |
commit | 169058e73fbe0b7cb7ff7e57c457093e5296532b (patch) | |
tree | 817deace2867dc0d83295d15aa4a538479f42760 /main/channel.c | |
parent | de86b30dbaaa616ca1752690c89eaa1bea4798a2 (diff) |
app_chanspy, channel: fix frame leaks
Fixed a couple of frame leaks that were found during testing.
ASTERISK-24828 #close
Reported by: John Hardin
Review: https://reviewboard.asterisk.org/r/4445/
........
Merged revisions 432362 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/channel.c b/main/channel.c index 09b8868cf..6c46d8741 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2824,14 +2824,14 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay) } } - if (res == 0) { - ast_channel_lock(chan); - while ((cur = AST_LIST_REMOVE_HEAD(&frames, frame_list))) { + ast_channel_lock(chan); + while ((cur = AST_LIST_REMOVE_HEAD(&frames, frame_list))) { + if (res == 0) { ast_queue_frame_head(chan, cur); - ast_frfree(cur); } - ast_channel_unlock(chan); + ast_frfree(cur); } + ast_channel_unlock(chan); } while (0); break; default: |