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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2015-02-26 17:06:01 +00:00
parent 8bb48e1f50
commit 9445a45188
2 changed files with 8 additions and 5 deletions

View File

@@ -648,6 +648,9 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto
while (ast_waitfor(chan, -1) > -1 && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) {
if (!(f = ast_read(chan)) || ast_check_hangup(chan)) {
running = -1;
if (f) {
ast_frfree(f);
}
break;
}