From: Saverio Proto Date: Thu, 14 Aug 2014 08:16:08 +0000 (+0200) Subject: finalize_join: close file descriptor before return X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=6440f8b01694e425c4d46cddb989e526a5f60fc3;p=meshlink finalize_join: close file descriptor before return --- diff --git a/src/meshlink.c b/src/meshlink.c index 1d52724e..30d71a2b 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -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);