From: Bard liao Date: Fri, 25 Jan 2019 20:06:45 +0000 (-0600) Subject: ASoC: topology: fix memory leak in soc_tplg_dapm_widget_create X-Git-Tag: v5.1-rc1~22^2~34^2~42 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7620fe9161cec2722db880affe03f5e9e2bb93d5;p=linux-block.git 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 Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 71bc5b8a9bd3..2cb0a05e2368 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1583,6 +1583,9 @@ widget: if (ret < 0) goto ready_err; + kfree(template.sname); + kfree(template.name); + return 0; ready_err: