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

Submitted by Andrey Vagin on July 12, 2018, 8:41 p.m.

Details

Message ID 20180712204145.6494-2-avagin@virtuozzo.com
State Accepted
Series "Series without cover letter"
Headers show

Commit Message

Andrey Vagin July 12, 2018, 8:41 p.m.
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@virtuozzo.com>
---
 criu/cr-service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;