correct logic flaw in ast_answer() changes in r182525
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 17 Mar 2009 14:59:33 +0000 (14:59 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 17 Mar 2009 14:59:33 +0000 (14:59 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182530 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 3520efc..8f90dcc 100644 (file)
@@ -1837,7 +1837,8 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer)
 
                        if (res == 0) {
                                ast_channel_lock(chan);
-                               while ((cur = AST_LIST_REMOVE(&frames, AST_LIST_LAST(&frames), frame_list))) {
+                               while ((cur = AST_LIST_LAST(&frames))) {
+                                       AST_LIST_REMOVE(&frames, cur, frame_list);
                                        ast_queue_frame_head(chan, cur);
                                        ast_frfree(cur);
                                }