diff --git a/main/autoservice.c b/main/autoservice.c index 1f18dee25f..d3d0333d1b 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -152,14 +152,7 @@ static void *autoservice_run(void *ign) } } - if (!defer_frame) { - if (f) { - ast_frfree(f); - } - continue; - } - - if (f) { + if (defer_frame) { for (i = 0; i < x; i++) { struct ast_frame *dup_f; @@ -167,12 +160,15 @@ static void *autoservice_run(void *ign) continue; } - if ((dup_f = ast_frdup(f))) { + if ((dup_f = ast_frdup(defer_frame))) { AST_LIST_INSERT_TAIL(&ents[i]->deferred_frames, dup_f, frame_list); } break; } + } + + if (f) { ast_frfree(f); } }