aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-21 19:43:46 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-21 19:43:46 +0000
commitfb3a7d23f2beab627cc0fef5d1c8c4a230f37c79 (patch)
tree5a0d47ceaf3db7998495e89aa18a2f404ccf6671 /main/channel.c
parent4c2a0cf977cb9b4a0313ebc22785c2ccb15eca29 (diff)
Add a check to fix a rare segmentation fault you'd get if ast_frdup couldn't allocate
memory on the first frame being queued in ast_queue_frame. (closes issue #17882) Reported by: seanbright Tested by: seanbright git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288005 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 2f7a20376..361286666 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -927,7 +927,9 @@ static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, in
AST_LIST_HEAD_INIT_NOLOCK(&frames);
for (cur = fin; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
if (!(f = ast_frdup(cur))) {
- ast_frfree(AST_LIST_FIRST(&frames));
+ if (AST_LIST_FIRST(&frames)) {
+ ast_frfree(AST_LIST_FIRST(&frames));
+ }
ast_channel_unlock(chan);
return -1;
}