From: Tycho Andersen Date: Tue, 9 Jun 2015 01:59:51 +0000 (-0600) Subject: c/r: use fclose instead of close X-Git-Tag: lxc-1.1.3~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f060d5fd19997a178acf2ae5f4375ac1e01b5c3;p=thirdparty%2Flxc.git 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 --- 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; }