From 13ddd84848402ed1d6ec10a6c5629d0dedbd088e Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 Apr 2024 09:46:11 -0700 Subject: [PATCH] tools: plugin: tplg: Free available formats Free the memory allocated for available input/output formats when the topology is freed. Signed-off-by: Ranjani Sridharan --- tools/plugin/alsaplug/tplg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/plugin/alsaplug/tplg.c b/tools/plugin/alsaplug/tplg.c index ccbef36c6e9e..ac56efa854b3 100644 --- a/tools/plugin/alsaplug/tplg.c +++ b/tools/plugin/alsaplug/tplg.c @@ -1456,7 +1456,12 @@ void plug_free_topology(snd_sof_plug_t *plug) list_for_item_safe(item, _item, &plug->widget_list) { 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(comp_info->name); free(comp_info->stream_name); free(comp_info->ipc_payload);