]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix the memory leak in cgfsng_attach 2288/head
authorLiFeng <lifeng68@huawei.com>
Tue, 24 Apr 2018 16:53:57 +0000 (12:53 -0400)
committerLiFeng <lifeng68@huawei.com>
Tue, 24 Apr 2018 16:53:57 +0000 (12:53 -0400)
Signed-off-by: LiFeng <lifeng68@huawei.com>
src/lxc/cgroups/cgfsng.c

index 10c7ab2cf0d983a3d3c277e466cac4f9345b0d77..18d04ea25276fa5310cdb1d98f57d7c91082b0e1 100644 (file)
@@ -2493,6 +2493,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);