ASoC: topology: fix memory leaks on sm, se and sbe
authorColin Ian King <colin.king@canonical.com>
Thu, 27 Jun 2019 13:32:08 +0000 (14:32 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jun 2019 14:08:49 +0000 (15:08 +0100)
commit1ad741d0e8e8ecccc16aa9ccb8362575197d91bf
tree175baf6ff9f597824379ae65961bfe1491d15468
parent8af26493c03581ad476a77630502de6152cf013d
ASoC: topology: fix memory leaks on sm, se and sbe

Currently when a kstrdup fails the error exit paths don't free
the allocations for sm, se and sbe.  This can be fixed by assigning
kc[i].private_value to these before doing the ksrtdup so that the error
exit path will be able to free these objects.

Addresses-Coverity: ("Resource leak")
Fixes: 9f90af3a9952 ("ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c