[asterisk-commits] russell: trunk r41864 - /trunk/main/channel.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sun Sep 3 09:41:03 MST 2006
Author: russell
Date: Sun Sep 3 11:41:02 2006
New Revision: 41864
URL: http://svn.digium.com/view/asterisk?rev=41864&view=rev
Log:
Don't use ast_frdup() in the AST_LIST_INSERT_TAIL macro directly. That was a
very stupid thing to do. It ends up duplicating the frame twice, linking in
one of them and setting the tail pointer to the other one. Sorry ...
Thanks to file for pointing out the breakage!!! file rocks.
Modified:
trunk/main/channel.c
Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?rev=41864&r1=41863&r2=41864&view=diff
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Sun Sep 3 11:41:02 2006
@@ -1334,6 +1334,7 @@
AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
struct ast_channel_spy_queue *queue;
+ struct ast_frame *duped_fr;
ast_mutex_lock(&spy->lock);
@@ -1364,7 +1365,7 @@
break;
}
}
- AST_LIST_INSERT_TAIL(&queue->list, ast_frdup(translated_frame), frame_list);
+ duped_fr = ast_frdup(translated_frame);
} else {
if (f->subclass != queue->format) {
ast_log(LOG_WARNING, "Spy '%s' on channel '%s' wants format '%s', but frame is '%s', dropping\n",
@@ -1373,8 +1374,10 @@
ast_mutex_unlock(&spy->lock);
continue;
}
- AST_LIST_INSERT_TAIL(&queue->list, ast_frdup(f), frame_list);
- }
+ duped_fr = ast_frdup(f);
+ }
+
+ AST_LIST_INSERT_TAIL(&queue->list, duped_fr, frame_list);
queue->samples += f->samples;
More information about the asterisk-commits
mailing list