Skip to content

Commit f100d37

Browse files
softwareckilgirdwood
authored andcommitted
module_adapter: Fix memory leak in module_adapter_new
Add missing memory deallocation in the error handling code of the module_adapter_new function. This memory can be allocated by the module_adapter_init_data function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent d4cd762 commit f100d37

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/audio/module_adapter/module_adapter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv,
126126
comp_dbg(dev, "module_adapter_new() done");
127127
return dev;
128128
err:
129+
#if CONFIG_IPC_MAJOR_4
130+
if (mod)
131+
rfree(mod->priv.cfg.input_pins);
132+
#endif
129133
rfree(mod);
130134
rfree(dev);
131135
return NULL;

0 commit comments

Comments
 (0)