From 3158ab5b9e16bb26267378bd54e113495631f8f2 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Mon, 8 Jun 2015 19:59:51 -0600 Subject: [PATCH] c/r: use fclose instead of close We're leaking the FILE* here while closing the underlying fd; let's just close the file and thus close both. Reported-by: Coverity Signed-off-by: Tycho Andersen Signed-off-by: Serge Hallyn --- src/lxc/criu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 667f5d978..adcc6262c 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -279,11 +279,11 @@ static bool criu_version_ok() goto version_error; version_match: - close(pipes[0]); + fclose(f); return true; version_error: - close(pipes[0]); + fclose(f); ERROR("must have criu " CRIU_VERSION " or greater to checkpoint/restore\n"); return false; } -- 2.47.2