From: John Ferlan Date: Fri, 22 Aug 2014 14:30:44 +0000 (-0400) Subject: commandtest: Resolve Coverity RESOURCE_LEAK X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e1d0471e587567647aae3ec7d81e12e88badd809;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git commandtest: Resolve Coverity RESOURCE_LEAK Since '62f263a73' - Coverity complains if the !pidfile path is taken, then newfd1 would be leaked. --- diff --git a/tests/commandtest.c b/tests/commandtest.c index b3287faa6..5f52a0085 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1081,6 +1081,7 @@ static int test24(const void *unused ATTRIBUTE_UNUSED) unlink(pidfile); VIR_FREE(pidfile); virCommandFree(cmd); + VIR_FORCE_CLOSE(newfd1); /* coverity[double_close] */ VIR_FORCE_CLOSE(newfd2); VIR_FORCE_CLOSE(newfd3);