From 16961e8a9d8ccb97254fe580170a515a8fda0cdd Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 Apr 2024 09:47:42 -0700 Subject: [PATCH] tools: plugin: tplg: Free tplg_base Free the memory allocated for tplg_base during topology free. Signed-off-by: Ranjani Sridharan --- tools/plugin/alsaplug/tplg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/plugin/alsaplug/tplg.c b/tools/plugin/alsaplug/tplg.c index ac56efa854b3..51c3c42b8d54 100644 --- a/tools/plugin/alsaplug/tplg.c +++ b/tools/plugin/alsaplug/tplg.c @@ -1445,6 +1445,7 @@ int plug_free_pipelines(snd_sof_plug_t *plug, struct tplg_pipeline_list *pipelin void plug_free_topology(snd_sof_plug_t *plug) { + struct tplg_context *ctx = &plug->tplg; struct list_item *item, *_item; list_for_item_safe(item, _item, &plug->pcm_list) { @@ -1458,10 +1459,8 @@ void plug_free_topology(snd_sof_plug_t *plug) struct tplg_comp_info *comp_info = container_of(item, struct tplg_comp_info, item); struct sof_ipc4_available_audio_format *available_fmts = &comp_info->available_fmt; - if (available_fmts->output_pin_fmts) - free(available_fmts->output_pin_fmts); - if (available_fmts->input_pin_fmts) - free(available_fmts->input_pin_fmts); + 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); @@ -1483,5 +1482,6 @@ void plug_free_topology(snd_sof_plug_t *plug) free(pipe_info); } + free(ctx->tplg_base); tplg_debug("freed all pipelines, widgets, routes and pcms\n"); }