From a12e2209ff382286adf17fa59cb9f8a87b784b2f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 16 Jul 2022 14:19:30 +0930 Subject: [PATCH] dualopend: fix memleak report. Not an important one, but memleak detection got upset: ``` 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: MEMLEAK: 0x55dd9797bb68 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: label=openingd/dualopend_wiregen.c:767:struct lease_rates 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: backtrace: 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: ccan/ccan/tal/tal.c:442 (tal_alloc_) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: openingd/dualopend_wiregen.c:767 (fromwire_dualopend_opener_init) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: openingd/dualopend.c:2671 (opener_start) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: openingd/dualopend.c:3649 (handle_master_in) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: openingd/dualopend.c:3973 (main) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: ../csu/libc-start.c:308 (__libc_start_main) 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: parents: 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#2: openingd/dualopend.c:3796:struct state ``` Signed-off-by: Rusty Russell --- openingd/dualopend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 14b1b13ba..e754b800f 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -2914,6 +2914,8 @@ static void opener_start(struct state *state, u8 *msg) tx_state->lease_chan_max_ppt = rates->channel_fee_max_proportional_thousandths; } + /* Keep memleak detector happy! */ + tal_free(expected_rates); /* Check that total funding doesn't overflow */ if (!amount_sat_add(&total, tx_state->opener_funding,