]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix coverity complain in commandtest.c
authorPavel Hrdina <phrdina@redhat.com>
Mon, 13 Jan 2014 15:50:00 +0000 (16:50 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 15 Jan 2014 10:18:23 +0000 (11:18 +0100)
For a "newfd1" the coverity tools thinks that the fd is closed in
a "virCommandPassFD", but with "flags == 0" it cannot be 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@redhat.com>
tests/commandtest.c

index 08e9e21fc6e5cc291f11be232de2cc006d109f09..7ff4d5fc59c5e52d9c790e0271a25eb265bd3045 100644 (file)
@@ -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;