[CRIU] [PATCH 6/8] sk-inet: don't leak sockets

Andrey Vagin avagin at openvz.org
Fri Oct 31 07:50:48 PDT 2014


CID 73347 (#7-4 of 7): Resource leak (RESOURCE_LEAK)
21. leaked_handle: Handle variable sk going out of scope leaks the handle.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sk-inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sk-inet.c b/sk-inet.c
index e38f1bf..adf6fc3 100644
--- a/sk-inet.c
+++ b/sk-inet.c
@@ -553,7 +553,7 @@ done:
 		goto err;
 
 	if (restore_socket_opts(sk, ie->opts))
-		return -1;
+		goto err;
 
 	return sk;
 
-- 
1.9.3



More information about the CRIU mailing list