[CRIU] [PATCH 5/5] log_init(): don't leak fd on error

Kir Kolyshkin kir at openvz.org
Tue May 5 15:31:12 PDT 2015


Reported by Coverity, CID 51641.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/log.c b/log.c
index e32e38b..3456daf 100644
--- a/log.c
+++ b/log.c
@@ -89,6 +89,7 @@ int log_init(const char *output)
 
 		if (cr_fchown(new_logfd)) {
 			pr_perror("Can't chown log file %s", output);
+			close(new_logfd);
 			return -1;
 		}
 	} else {
-- 
1.9.3



More information about the CRIU mailing list