Commit d1ee2801 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

files-reg: don't leak a file descriptor

CID 154850 (#1 of 1): Resource leak (RESOURCE_LEAK)
9. leaked_handle: Handle variable cwd_fd going out of scope leaks the handle.

Reported-by: coverity
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d55e13d4
......@@ -471,6 +471,7 @@ void try_clean_remaps(int ns_fd)
if (setns(ns_fd, CLONE_NEWNS) < 0) {
close(old_ns);
close(cwd_fd);
pr_perror("`- Can't switch");
return;
}
......
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