]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix the memory leak in cgfsng_attach
authorLiFeng <lifeng68@huawei.com>
Tue, 24 Apr 2018 16:53:57 +0000 (12:53 -0400)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 23 Aug 2018 20:56:01 +0000 (22:56 +0200)
Signed-off-by: LiFeng <lifeng68@huawei.com>
src/lxc/cgroups/cgfsng.c

index a17d59b1275ac7eeab25ac45e5b7f4f1450ad9e2..3677d4fe3f1e870ddaae47f90a1732bca81e6771 100644 (file)
@@ -2471,6 +2471,7 @@ static bool cgfsng_attach(const char *name, const char *lxcpath, pid_t pid)
                        continue;
 
                fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
+               free(path);
                ret = lxc_write_to_file(fullpath, pidstr, len, false);
                if (ret < 0) {
                        SYSERROR("Failed to attach %d to %s", (int)pid, fullpath);