mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
tests: Resolve Coverity RESOURCE_LEAK
The 'lib' handle will be leaked if 'dlsym' condition fails. So close the handle before return. Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
This commit is contained in:
parent
8879185cce
commit
64cef432aa
@ -114,6 +114,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
}
|
||||
if (!(startup = dlsym(lib, "shunloadStart"))) {
|
||||
fprintf(stderr, "Cannot find shunloadStart %s\n", dlerror());
|
||||
dlclose(lib);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user