2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 22:35:33 +00:00

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: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-04-05 01:44:35 +04:00
committed by Pavel Emelyanov
parent 055b937226
commit a520b1b8cd

View File

@@ -58,6 +58,8 @@ int restore_ns(int rst, struct ns_desc *nd)
if (ret < 0)
pr_perror("Can't restore ns back");
close(rst);
return ret;
}