From: Serge Hallyn Date: Mon, 7 Oct 2013 19:10:29 +0000 (-0500) Subject: coverity: free dent_buf on error path (cgroup.c) X-Git-Tag: lxc-1.0.0.alpha2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034ef75d494c5ee6d46c04c3659a5be121a943ca;p=thirdparty%2Flxc.git coverity: free dent_buf on error path (cgroup.c) Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 49cc19055..5831e4e4c 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -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] = {