ASoC: topology: fix memory leak in soc_tplg_dapm_widget_create

template.sname and template.name are only freed when an error occur.
They should be freed in the success return case, too.

Signed-off-by: Bard liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Bard liao
2019-01-29 18:03:32 +00:00
committed by Mark Brown
parent 34db6a3e91
commit 7620fe9161
+3
View File
@@ -1583,6 +1583,9 @@ widget:
if (ret < 0)
goto ready_err;
kfree(template.sname);
kfree(template.name);
return 0;
ready_err: