mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
gossipd: fix take leak when peer is dying.
In this case, local and remote are *both* NULL; so if someone tries to send a packet with take(), we need to free it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
a7e6cdb418
commit
5c19c55841
@@ -506,6 +506,9 @@ static void queue_peer_msg(struct peer *peer, const u8 *msg TAKES)
|
||||
if (taken(msg))
|
||||
tal_free(msg);
|
||||
daemon_conn_send(peer->remote, take(send));
|
||||
} else { /* Waiting to die. */
|
||||
if (taken(msg))
|
||||
tal_free(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user