From 3408f8f9988cfc695f329ccb6087b4b262343ce3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 25 Nov 2020 10:48:43 +1030 Subject: [PATCH] gossipd: fix memleak. Not really a leak, since we eventually process pending, but still: ``` **BROKEN** gossipd: MEMLEAK: 0x5562fa63bab8 **BROKEN** gossipd: label=wire/peer_exp_wiregen.c:3858:u8[] DEBUG gossipd: backtrace: DEBUG gossipd: ccan/ccan/tal/tal.c:442 (tal_alloc_) DEBUG gossipd: ccan/ccan/tal/tal.c:471 (tal_alloc_arr_) DEBUG gossipd: wire/peer_exp_wiregen.c:3858 (fromwire_channel_announcement) DEBUG gossipd: gossipd/routing.c:1706 (handle_channel_announcement) DEBUG gossipd: gossipd/gossipd.c:238 (handle_channel_announcement_msg) DEBUG gossipd: gossipd/gossipd.c:444 (peer_msg_in) DEBUG gossipd: common/daemon_conn.c:31 (handle_read) DEBUG gossipd: ccan/ccan/io/io.c:59 (next_plan) DEBUG gossipd: ccan/ccan/io/io.c:407 (do_plan) DEBUG gossipd: ccan/ccan/io/io.c:417 (io_ready) DEBUG gossipd: ccan/ccan/io/poll.c:445 (io_loop) DEBUG gossipd: gossipd/gossipd.c:1730 (main) **BROKEN** gossipd: parents: **BROKEN** gossipd: gossipd/routing.c:1698:struct pending_cannouncement **BROKEN** gossipd: gossipd/gossipd.c:1700:struct daemon ``` Signed-off-by: Rusty Russell --- gossipd/routing.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gossipd/routing.c b/gossipd/routing.c index 52a573b09..ded1f59bc 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1721,6 +1721,9 @@ u8 *handle_channel_announcement(struct routing_state *rstate, goto malformed; } + /* We don't use features */ + tal_free(features); + /* If we know the blockheight, and it's in the future, reject * out-of-hand. Remember, it should be 6 deep before they tell us * anyway. */