[CRIU] [PATCH v6 13/13] sysctl: fix sysctl file to close in error path

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Apr 25 07:56:54 PDT 2016


https://jira.sw.ru/browse/PSBM-30942

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/sysctl.c b/criu/sysctl.c
index d8fa04a..d44db6a 100644
--- a/criu/sysctl.c
+++ b/criu/sysctl.c
@@ -378,9 +378,9 @@ static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op)
 		req->flags |= CTL_FLAGS_HAS;
 
 		ret = do_sysctl_op(fd, req, op);
+		close(fd);
 		if (ret)
 			goto out;
-		close(fd);
 		req++;
 	}
 
-- 
1.9.3



More information about the CRIU mailing list