take: allocate temporary variables off NULL.

If we're going to simply take() a pointer, don't allocate it off a random
object.  Using NULL makes our intent clear, particularly with allocating
packets we're going to take() onto a queue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-15 16:40:22 +10:30
parent 0a6e3d1e13
commit e63b7bb539
7 changed files with 76 additions and 76 deletions

View File

@@ -293,7 +293,7 @@ void channel_fail_permanent(struct channel *channel, const char *fmt, ...)
va_end(ap);
if (channel->scid) {
msg = towire_gossip_disable_channel(channel,
msg = towire_gossip_disable_channel(NULL,
channel->scid,
channel->peer->direction,
false);
@@ -390,7 +390,7 @@ void channel_fail_transient(struct channel *channel, const char *fmt, ...)
if (ld->no_reconnect)
return;
#endif /* DEVELOPER */
u8 *msg = towire_gossipctl_reach_peer(channel,
u8 *msg = towire_gossipctl_reach_peer(NULL,
&channel->peer->id);
subd_send_msg(ld->gossip, take(msg));
}