mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant
Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
This commit is contained in:
10
main/frame.c
10
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);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user