Skip to content

Commit 40a86da

Browse files
committed
lightningd: fix crash in "shouldn't happen" path.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 9b662a8 commit 40a86da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightningd/channel_gossip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,12 +1096,12 @@ void channel_gossip_update_from_gossipd(struct channel *channel,
10961096
case CGOSSIP_CHANNEL_ANNOUNCED_DYING:
10971097
case CGOSSIP_CHANNEL_ANNOUNCED_DEAD:
10981098
/* Shouldn't happen. */
1099-
if (taken(channel_update))
1100-
tal_free(channel_update);
11011099
log_broken(channel->log,
11021100
"gossipd gave channel_update in %s? update=%s",
11031101
channel_gossip_state_str(channel->channel_gossip->state),
11041102
tal_hex(tmpctx, channel_update));
1103+
if (taken(channel_update))
1104+
tal_free(channel_update);
11051105
return;
11061106

11071107
/* This happens: we step back a block when restarting. */

0 commit comments

Comments
 (0)