Fix a potential file descriptor leak.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 12 Jul 2014 12:34:39 +0000 (14:34 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 12 Jul 2014 12:34:39 +0000 (14:34 +0200)
Found by cppcheck.

src/invitation.c

index a6996cc..28f9f8c 100644 (file)
@@ -613,6 +613,7 @@ make_names:
        FILE *fh = fopen(filename, "w");
        if(!fh) {
                fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
+               fclose(f);
                return false;
        }