mirror of https://gitee.com/openkylin/libvirt.git
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