X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=e2fe28b40d972d68a5a8023d5c4cef71045599f0;hb=1442d234fb6681e32b10348a6c7b226c11629203;hp=d26b0f651f3dde6c374a7dcd49784d998bb6efde;hpb=53522b1c11222273c7b41f72b374e759d13b2165;p=meshlink diff --git a/src/protocol_auth.c b/src/protocol_auth.c index d26b0f65..e2fe28b4 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -205,7 +205,7 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat config_t config; - if(!invitation_read(mesh, cookie, &config)) { + if(!invitation_read(mesh, "current", cookie, &config, mesh->config_key)) { logger(mesh, MESHLINK_ERROR, "Error while trying to read invitation file\n"); return false; } @@ -238,6 +238,9 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat // Send the node the contents of the invitation file sptps_send_record(&c->sptps, 0, config.buf, config.len); + config_free(&config); + free(submesh_name); + c->status.invitation_used = true; logger(mesh, MESHLINK_INFO, "Invitation %s successfully sent to %s", cookie, c->name);