Commit 71cb9afb by LiFeng

Fix the memory leak in cgfsng_attach

Signed-off-by: 's avatarLiFeng <lifeng68@huawei.com>
parent d31660ef
...@@ -2493,6 +2493,7 @@ static bool cgfsng_attach(const char *name, const char *lxcpath, pid_t pid) ...@@ -2493,6 +2493,7 @@ static bool cgfsng_attach(const char *name, const char *lxcpath, pid_t pid)
continue; continue;
fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs"); fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
free(path);
ret = lxc_write_to_file(fullpath, pidstr, len, false); ret = lxc_write_to_file(fullpath, pidstr, len, false);
if (ret < 0) { if (ret < 0) {
SYSERROR("Failed to attach %d to %s", (int)pid, fullpath); SYSERROR("Failed to attach %d to %s", (int)pid, fullpath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment