mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +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:
parent
a7e6cdb418
commit
5c19c55841
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue