]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: use fclose instead of close
authorTycho Andersen <tycho.andersen@canonical.com>
Tue, 9 Jun 2015 01:59:51 +0000 (19:59 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 17:46:05 +0000 (13:46 -0400)
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 <tycho.andersen@canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/criu.c

index 667f5d978756580fc05524fd1f2edacd919194ea..adcc6262c12c3b196e4e8bb7bcbbc2c0d7c4ebbb 100644 (file)
@@ -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;
        }