From f66a585e042fbb2f313c1cbde329088fac86cea6 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 25 Jun 2013 16:07:42 -0400 Subject: Coverity fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a 4 coverity issues, ranging from memory leaks, to uninitialized variables, to potential NULL derefernce. Also a TOCTOU report that is in one of the accessory test scripts. The bug itself is not reallya TOCTOU, but the check done in the script is unecessary, so I just removed it. Signed-off-by: Simo Sorce Reviewed-by: Günther Deschner --- proxy/tests/scripts/dlopen.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'proxy/tests/scripts') diff --git a/proxy/tests/scripts/dlopen.sh b/proxy/tests/scripts/dlopen.sh index 890cc39..1896a83 100755 --- a/proxy/tests/scripts/dlopen.sh +++ b/proxy/tests/scripts/dlopen.sh @@ -7,12 +7,10 @@ cat >> $tempdir/dlopen.c << _EOF #include #include #include -#include /* Simple program to see if dlopen() would succeed. */ int main(int argc, char **argv) { int i; - struct stat st; char buf[PATH_MAX]; for (i = 1; i < argc; i++) { if (dlopen(argv[i], RTLD_NOW)) { @@ -20,7 +18,7 @@ int main(int argc, char **argv) argv[i]); } else { snprintf(buf, sizeof(buf), "./%s", argv[i]); - if ((stat(buf, &st) == 0) && dlopen(buf, RTLD_NOW)) { + if (dlopen(buf, RTLD_NOW)) { fprintf(stdout, "dlopen() of \"./%s\" " "succeeded.\n", argv[i]); } else { -- cgit