2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

tcp: don't leak a file descriptor

CID 164719 (#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_handle: Handle variable sk going out of scope leaks the handle.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Andrew Vagin 2016-08-05 01:52:00 +03:00 committed by Pavel Emelyanov
parent 290e238d01
commit 034bfe16c9

View File

@ -840,6 +840,7 @@ int kerndat_tcp_repair_window()
if (errno == EPERM) {
kdat.has_tcp_window = false;
pr_warn("TCP_REPAIR isn't available to unprivileged users\n");
close(sk);
return 0;
}
pr_perror("Unable to set TCP_REPAIR");