Skip to content

Commit

Permalink
Copy Ranjani's plugin leak fixes from thesofproject#9055.
Browse files Browse the repository at this point in the history
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Aug 29, 2024
1 parent e1829b0 commit 389a9e0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/testbench/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ int tb_parse_topology(struct testbench_prm *tb)

out:
/* free all data */
free(ctx->tplg_base);

// TODO: Check this
// free(ctx->tplg_base);
return ret;
}

Expand Down Expand Up @@ -917,6 +919,8 @@ void tb_free_topology(struct testbench_prm *tb)
struct tplg_comp_info *comp_info;
struct tplg_route_info *route_info;
struct tplg_pipeline_info *pipe_info;
struct tplg_context *ctx = &tb->tplg;
struct sof_ipc4_available_audio_format *available_fmts;
struct list_item *item, *_item;

list_for_item_safe(item, _item, &tb->pcm_list) {
Expand All @@ -927,6 +931,9 @@ void tb_free_topology(struct testbench_prm *tb)

list_for_item_safe(item, _item, &tb->widget_list) {
comp_info = container_of(item, struct tplg_comp_info, item);
available_fmts = &comp_info->available_fmt;
free(available_fmts->output_pin_fmts);
free(available_fmts->input_pin_fmts);
free(comp_info->name);
free(comp_info->stream_name);
free(comp_info->ipc_payload);
Expand All @@ -944,5 +951,7 @@ void tb_free_topology(struct testbench_prm *tb)
free(pipe_info);
}

// TODO: Do here or earlier?
free(ctx->tplg_base);
tplg_debug("freed all pipelines, widgets, routes and pcms\n");
}

0 comments on commit 389a9e0

Please sign in to comment.