Merge pull request #2288 from lifeng68/Fix_mem_leak_cgfsng_attach

Fix the memory leak in cgfsng_attach
This commit is contained in:
Christian Brauner 2018-04-24 10:40:22 +02:00 committed by GitHub
commit 48d02a2f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);