summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-11-11 09:42:01 -0600
committerRichard Mudgett <rmudgett@digium.com>2017-11-11 13:03:31 -0600
commitbb2173275a114b4b1cbdb23ff5884cab822ac7f1 (patch)
treef53ed3e27e822b83288b526433e8c1d44e06c1e8 /main
parent1250b7c66401910f1b41f01b783725d9c99c7255 (diff)
frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant
Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
Diffstat (limited to 'main')
-rw-r--r--main/frame.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/main/frame.c b/main/frame.c
index 4261b04dd..9fd1f7889 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -165,18 +165,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);
}
/*!