[CRIU] [PATCH] check: don't lead fd

Andrey Vagin avagin at openvz.org
Fri Nov 28 00:00:23 PST 2014


CID 83243 (#1 of 1): Resource leak (RESOURCE_LEAK)
6. leaked_handle: Handle variable fd going out of scope leaks the handle.

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

diff --git a/cr-check.c b/cr-check.c
index 570f945..f384bdf 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -228,6 +228,7 @@ static int check_fcntl(void)
 
 	if (fcntl(fd, F_GETOWNER_UIDS, (long)v)) {
 		pr_perror("Can'r fetch file owner UIDs");
+		close(fd);
 		return -1;
 	}
 
-- 
1.9.3



More information about the CRIU mailing list