Skip to content

Commit 6ac84d4

Browse files
softwareckilgirdwood
authored andcommitted
lib_manager: Fix memory leak in lib_manager_register_module
Free allocated driver structure when an unsupported loadable module api version is detected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 8223d87 commit 6ac84d4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/library_manager/lib_manager.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,8 @@ int lib_manager_register_module(const uint32_t component_id)
654654
if (build_info->format != SOF_MODULE_API_BUILD_INFO_FORMAT ||
655655
build_info->api_version_number.full != SOF_MODULE_API_CURRENT_VERSION) {
656656
tr_err(&lib_manager_tr, "Unsupported module API version");
657-
return -ENOEXEC;
657+
ret = -ENOEXEC;
658+
goto cleanup;
658659
}
659660
}
660661
}

0 commit comments

Comments
 (0)