[PATCH] util: Fix Coverity RESOURCE_LEAK

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

 



Commit id 'e44b0269c9' in advertently checked !dir before calling closedir

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---

Pushed as trivial 

 src/util/virprocess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index f1924eb..8fa7a9b 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -638,7 +638,7 @@ int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)
     ret = 0;
 
  cleanup:
-    if (!dir)
+    if (dir)
         closedir(dir);
     VIR_FREE(taskPath);
     if (ret < 0)
-- 
2.1.0

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