From ad5fd9b87b772418d1b7efcca275166efb1cf856 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 16 Jun 2015 09:15:10 -0400 Subject: [PATCH] util: Fix Coverity RESOURCE_LEAK Commit id 'e44b0269c9' in advertently checked !dir before calling closedir --- 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 f1924eb5c3..8fa7a9b2a4 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)