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;
}
// 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);