diff options
Diffstat (limited to 'main/message.c')
-rw-r--r-- | main/message.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/message.c b/main/message.c index 581487fcd..01a1c9b1c 100644 --- a/main/message.c +++ b/main/message.c @@ -743,6 +743,7 @@ static void chan_cleanup(struct ast_channel *chan) struct ast_datastore *msg_ds, *ds; struct varshead *headp; struct ast_var_t *vardata; + struct ast_frame *cur; ast_channel_lock(chan); @@ -772,6 +773,13 @@ static void chan_cleanup(struct ast_channel *chan) } /* + * Remove frames from read queue + */ + while ((cur = AST_LIST_REMOVE_HEAD(ast_channel_readq(chan), frame_list))) { + ast_frfree(cur); + } + + /* * Restore msg datastore. */ if (msg_ds) { |