Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
5c19c55841
  1. 3
      gossipd/gossip.c

3
gossipd/gossip.c

@ -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…
Cancel
Save