]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
finalize_join: close file descriptor before return
[meshlink] / src / meshlink.c
index 1d52724e26d6e31b52255bbb2ae8976e4edbb770..30d71a2bef709136edf1cff2a296fd6a01f117f9 100644 (file)
@@ -503,8 +503,10 @@ static bool finalize_join(meshlink_handle_t *mesh) {
        }
 
        char *b64key = ecdsa_get_base64_public_key(mesh->self->connection->ecdsa);
-       if(!b64key)
+       if(!b64key) {
+               fclose(fh);
                return false;
+               }
 
        fprintf(fh, "ECDSAPublicKey = %s\n", b64key);
        fprintf(fh, "Port = %s\n", mesh->myport);