summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/frame.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/main/frame.c b/main/frame.c
index c24cc8f78..8a151eff8 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -163,18 +163,16 @@ void ast_frame_free(struct ast_frame *frame, int cache)
{
struct ast_frame *next;
- for (next = AST_LIST_NEXT(frame, frame_list);
- frame;
- frame = next, next = frame ? AST_LIST_NEXT(frame, frame_list) : NULL) {
+ while (frame) {
+ next = AST_LIST_NEXT(frame, frame_list);
__frame_free(frame, cache);
+ frame = next;
}
}
void ast_frame_dtor(struct ast_frame *f)
{
- if (f) {
- ast_frfree(f);
- }
+ ast_frfree(f);
}
/*!