mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Check correct values in the return of ast_waitfor(); also, get rid of a
possible memory leak. (closes issue #13658) Reported by: explidous Patch by: me git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -107,13 +107,13 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
|
||||
res = ast_waitfor(chan, silencereqd);
|
||||
|
||||
/* Must have gotten a hangup; let's exit */
|
||||
if (res <= 0) {
|
||||
if (res < 0) {
|
||||
f = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* We waited and got no frame; sounds like digital silence or a muted digital channel */
|
||||
if (!res) {
|
||||
if (res == 0) {
|
||||
dspsilence = silencereqd;
|
||||
} else {
|
||||
/* Looks like we did get a frame, so let's check it out */
|
||||
@@ -122,6 +122,8 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
|
||||
break;
|
||||
if (f && f->frametype == AST_FRAME_VOICE) {
|
||||
ast_dsp_silence(sildet, f, &dspsilence);
|
||||
}
|
||||
if (f) {
|
||||
ast_frfree(f);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user