]> git.meshlink.io Git - meshlink/commitdiff
finalize_join: close file descriptor before return
authorSaverio Proto <zioproto@gmail.com>
Thu, 14 Aug 2014 08:16:08 +0000 (10:16 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 11:28:33 +0000 (13:28 +0200)
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);