Skip to content

Commit ddb091d

Browse files
haoxian2pcolberg
authored andcommitted
Fixed coverity in acl_hal_mmd.cpp: Resource leak (RESOURCE_LEAK)
mmd_libraries were not closed after execution, which causes memory leaks. But mmd_libraries cannot be closed trivially since closing the library invalidates the symbol return by dlsym(), which means calling the function further down is undefined behaviour. To solve this issues, I added a `dl_wrapper_t` vector as a global initialized vector that would be deallocated when closing the runtime library. This vector would contain all the opened libraries that would be closed by the destructor of `dl_wrapper_t` once the vector deallocates.
1 parent c4d6d04 commit ddb091d

File tree

1 file changed

+127
-147
lines changed

1 file changed

+127
-147
lines changed

0 commit comments

Comments
 (0)