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:
Wang Rui 2014-08-28 18:20:57 +08:00 committed by Ján Tomko
parent 8879185cce
commit 64cef432aa

View File

@ -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;
}