Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ea41674 authored by Jeeja KP's avatar Jeeja KP Committed by Mark Brown
Browse files

ASoC: topology: Fix memory leak in widget creation



name and sname allocated in widget create are not freed when
creation is successful, so free them.

Signed-off-by: default avatarJeeja KP <jeeja.kp@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 06eb49f7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1481,6 +1481,8 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
	widget->dobj.type = SND_SOC_DOBJ_WIDGET;
	widget->dobj.ops = tplg->ops;
	widget->dobj.index = tplg->index;
	kfree(template.sname);
	kfree(template.name);
	list_add(&widget->dobj.list, &tplg->comp->dobj_list);
	return 0;