coverity: free dent_buf on error path (cgroup.c)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2013-10-07 14:10:29 -05:00
parent 5903da8289
commit 034ef75d49

View File

@ -1864,8 +1864,10 @@ int cgroup_recursive_task_count(const char *cgroup_path)
process_lock();
d = opendir(cgroup_path);
process_unlock();
if (!d)
if (!d) {
free(dent_buf);
return 0;
}
while (readdir_r(d, dent_buf, &dent) == 0 && dent) {
const char *parts[3] = {