aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-16 14:00:21 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-16 14:00:21 +0000
commitba78c1a523431f09a9008e3e4640021348268527 (patch)
treefe5a9adfde1977a8195b73ec595b684c02e8c592 /main
parented1bdb3a29614a70745004c398a415087b5972ea (diff)
Merged revisions 182171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r182171 | file | 2009-03-16 10:58:24 -0300 (Mon, 16 Mar 2009) | 7 lines Fix a memory leak in the ast_answer / __ast_answer API call. For a channel that is not yet answered this API call will wait until a voice frame is received on the channel before returning. It does this by waiting for frames on the channel and reading them in. The frames read in were not freed when they should have been. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@182173 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index bf5006de5..830f4b1b4 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1730,14 +1730,19 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer)
}
f = ast_read(chan);
if (!f || (f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HANGUP)) {
+ if (f) {
+ ast_frfree(f);
+ }
res = -1;
ast_debug(2, "Hangup of channel %s detected in answer routine\n", chan->name);
break;
}
if (f->frametype == AST_FRAME_VOICE) {
+ ast_frfree(f);
res = 0;
break;
}
+ ast_frfree(f);
}
}
break;