mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
sphinx: fix leaks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
f19e02eeaa
commit
8c4eecc089
@@ -355,8 +355,11 @@ struct onionpacket *create_onionpacket(
|
||||
struct hop_params *params = generate_hop_params(ctx, sessionkey, path);
|
||||
struct secret *secrets = tal_arr(ctx, struct secret, num_hops);
|
||||
|
||||
if (!params)
|
||||
if (!params) {
|
||||
tal_free(packet);
|
||||
tal_free(secrets);
|
||||
return NULL;
|
||||
}
|
||||
packet->version = 0;
|
||||
memset(nexthmac, 0, SECURITY_PARAMETER);
|
||||
memset(packet->routinginfo, 0, ROUTING_INFO_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user