[PATCH 6/6] Fix coverity complain in commandtest.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For a "newfd1" the coverity tool thinks that the fd is closed in
a "virCommandPassFD", but with "flags == 0" it cannot be never
closed.

The code itself is ok, but coverity tool thinks that there is
"double_close" of the "newfd1" and to prevent showing this error
we simply add a comment before the proper close.

This has been found by coverity.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 tests/commandtest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index 08e9e21..7ff4d5f 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -215,6 +215,7 @@ static int test3(const void *unused ATTRIBUTE_UNUSED)
 
 cleanup:
     virCommandFree(cmd);
+    /* coverity[double_close] */
     VIR_FORCE_CLOSE(newfd1);
     VIR_FORCE_CLOSE(newfd2);
     return ret;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]