From: LiFeng Date: Tue, 24 Apr 2018 16:53:57 +0000 (-0400) Subject: Fix the memory leak in cgfsng_attach X-Git-Tag: lxc-2.0.10~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db54377ec586ff376146a9b46550d6a550253aa;p=thirdparty%2Flxc.git Fix the memory leak in cgfsng_attach Signed-off-by: LiFeng --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index a17d59b12..3677d4fe3 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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);