Skip to content

Commit

Permalink
tools: plugin: tplg: Free available formats
Browse files Browse the repository at this point in the history
Free the memory allocated for available input/output formats when the
topology is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
  • Loading branch information
ranj063 committed Apr 16, 2024
1 parent a43981e commit 13ddd84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/plugin/alsaplug/tplg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13ddd84

Please sign in to comment.