]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: free dent_buf on error path (cgroup.c)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 7 Oct 2013 19:10:29 +0000 (14:10 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 7 Oct 2013 19:10:29 +0000 (14:10 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgroup.c

index 49cc19055803ec7bd9bc33e97e7dc6ee2db8da6b..5831e4e4c7efbbce1e3491bc508d86c51bbff4eb 100644 (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] = {