ASoC: topology: fix memory leak in soc_tplg_dapm_widget_create
authorBard liao <yung-chuan.liao@linux.intel.com>
Fri, 25 Jan 2019 20:06:45 +0000 (14:06 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 29 Jan 2019 18:03:32 +0000 (18:03 +0000)
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 <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index 71bc5b8a9bd3c8eead6b7d94a4bbf4985a9dbe10..2cb0a05e2368d36b2b0502832184ca588c5f3dd7 100644 (file)
@@ -1583,6 +1583,9 @@ widget:
        if (ret < 0)
                goto ready_err;
 
+       kfree(template.sname);
+       kfree(template.name);
+
        return 0;
 
 ready_err: