[CRIU] [PATCH 2/4] service: don't leak a file descriptor

Andrei Vagin avagin at virtuozzo.com
Thu Jul 12 23:41:43 MSK 2018


CID 190777 (#1 of 1): Resource leak (RESOURCE_LEAK)
15. leaked_handle: Handle variable server_fd going out of scope leaks the handle.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/cr-service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 3a07d5b76..e9401be3a 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -1207,7 +1207,7 @@ int cr_service(bool daemon_mode)
 		goto err;
 
 	if (close_status_fd())
-		return -1;
+		goto err;
 
 	while (1) {
 		int sk;
-- 
2.14.3



More information about the CRIU mailing list