util: Fix Coverity RESOURCE_LEAK

Commit id 'e44b0269c9' in advertently checked !dir before calling closedir
This commit is contained in:
John Ferlan 2015-06-16 09:15:10 -04:00
parent 4ec52c364b
commit ad5fd9b87b

View 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)