From: Wang Rui Date: Thu, 28 Aug 2014 10:20:57 +0000 (+0800) Subject: tests: Resolve Coverity RESOURCE_LEAK X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=64cef432aacea9a9709187910d3014946e42dc68;p=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 --- diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c index 499b1be5d4..80f535134f 100644 --- a/tests/shunloadtest.c +++ b/tests/shunloadtest.c @@ -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; }