Re: [PATCH 1/3] commandtest: Resolve Coverity RESOURCE_LEAK

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

 



On 22.08.2014 17:28, John Ferlan wrote:
Since '62f263a73' - Coverity complains if the !pidfile path is taken,
then newfd1 would be leaked.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
  tests/commandtest.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index b3287fa..5f52a00 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);



ACK

Michal

--
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]