From 034bfe16c9970937211fdbcec7d3ecc57c75a939 Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Fri, 5 Aug 2016 01:52:00 +0300 Subject: [PATCH] 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 Signed-off-by: Pavel Emelyanov --- criu/sk-tcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/sk-tcp.c b/criu/sk-tcp.c index ae1d8a256..86534a465 100644 --- a/criu/sk-tcp.c +++ b/criu/sk-tcp.c @@ -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");