From 6440f8b01694e425c4d46cddb989e526a5f60fc3 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Thu, 14 Aug 2014 10:16:08 +0200 Subject: [PATCH] finalize_join: close file descriptor before return --- src/meshlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.5