gossipd/routing: free everything at end of tests.

valgrind complains, but using a destructor on the node map is a good
idea anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-09-01 13:48:54 +09:30 committed by Christian Decker
parent ffaab09043
commit 9c35603275
3 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,7 @@ struct node_map *empty_node_map(const tal_t *ctx)
{
struct node_map *map = tal(ctx, struct node_map);
node_map_init(map);
tal_add_destructor(map, node_map_clear);
return map;
}

View File

@ -120,5 +120,6 @@ int main(void)
assert(pubkey_eq(&route[0]->dst->id, &c));
tal_free(ctx);
secp256k1_context_destroy(secp256k1_ctx);
return 0;
}

View File

@ -123,5 +123,6 @@ int main(void)
assert(fee == 0 + 6);
tal_free(ctx);
secp256k1_context_destroy(secp256k1_ctx);
return 0;
}