]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Close file handle in create_cachedirtag on write error
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 18 Dec 2010 09:01:15 +0000 (10:01 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 18 Dec 2010 09:01:15 +0000 (10:01 +0100)
util.c

diff --git a/util.c b/util.c
index f71318829b8f578d19f725eba69e174494db8ef0..e534671485b51f6f5877dac8f512dadbf19a7041 100644 (file)
--- a/util.c
+++ b/util.c
@@ -463,6 +463,7 @@ create_cachedirtag(const char *dir)
        f = fopen(filename, "w");
        if (!f) goto error;
        if (fwrite(CACHEDIR_TAG, sizeof(CACHEDIR_TAG)-1, 1, f) != 1) {
+               fclose(f);
                goto error;
        }
        if (fclose(f)) goto error;