Merge branch 'winwarnings' of https://github.com/dechamps/tinc into 1.1
[tinc] / src / invitation.c
index 7fb96da..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;
        }
 
@@ -906,7 +907,7 @@ int cmd_join(int argc, char *argv[]) {
        if(!port || !*port)
                port = "655";
 
-       if(!b64decode(slash, hash, 18) || !b64decode(slash + 24, cookie, 18))
+       if(!b64decode(slash, hash, 24) || !b64decode(slash + 24, cookie, 24))
                goto invalid;
 
        // Generate a throw-away key for the invitation.