Commit a520b1b8 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

namespaces: close fd on the source netns in restore_ns

It's opened in switch_ns.

CID 996194 (#3 of 5): Resource leak (RESOURCE_LEAK)
11. leaked_handle: Handle variable rst going out of scope leaks the handle.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 055b9372
...@@ -58,6 +58,8 @@ int restore_ns(int rst, struct ns_desc *nd) ...@@ -58,6 +58,8 @@ int restore_ns(int rst, struct ns_desc *nd)
if (ret < 0) if (ret < 0)
pr_perror("Can't restore ns back"); pr_perror("Can't restore ns back");
close(rst);
return ret; return ret;
} }
......
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