]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Fix Coverity RESOURCE_LEAK
authorJohn Ferlan <jferlan@redhat.com>
Tue, 16 Jun 2015 13:15:10 +0000 (09:15 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 16 Jun 2015 13:15:10 +0000 (09:15 -0400)
Commit id 'e44b0269c9' in advertently checked !dir before calling closedir

src/util/virprocess.c

index f1924eb5c34d204eddf07ccf00bdf58cd2692d68..8fa7a9b2a4897a59bb2d80754795800f978c2828 100644 (file)
@@ -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)