From 4f16f50353030cb71df51665a8b08a02f2179ab6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 14 Aug 2023 16:54:46 +0930 Subject: [PATCH] renepay: don't free adg twice after adding gossip. It will usually be freed by the call to pay_flow_finished_adding_gossip. ``` cln-renepay: FATAL SIGNAL 6 (version 862dac2-modded) 0x561f232f32f8 call_error /home/runner/work/lightning/lightning/ccan/ccan/tal/tal.c:95 0x561f232f3df8 check_bounds /home/runner/work/lightning/lightning/ccan/ccan/tal/tal.c:169 0x561f232f2281 to_tal_hdr /home/runner/work/lightning/lightning/ccan/ccan/tal/tal.c:179 0x561f232f2189 tal_free /home/runner/work/lightning/lightning/ccan/ccan/tal/tal.c:514 0x561f2327f801 addgossip_done /home/runner/work/lightning/lightning/plugins/renepay/pay.c:170 0x561f23292d9b handle_rpc_reply /home/runner/work/lightning/lightning/plugins/libplugin.c:871 0x561f23292a90 rpc_read_response_one /home/runner/work/lightning/lightning/plugins/libplugin.c:1048 0x561f23292811 rpc_conn_read_response /home/runner/work/lightning/lightning/plugins/libplugin.c:1072 0x561f232dc0f2 next_plan /home/runner/work/lightning/lightning/ccan/ccan/io/io.c:59 ``` Signed-off-by: Rusty Russell --- plugins/renepay/pay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/renepay/pay.c b/plugins/renepay/pay.c index bfbaf38fc..b3ef3956a 100644 --- a/plugins/renepay/pay.c +++ b/plugins/renepay/pay.c @@ -166,8 +166,9 @@ static struct command_result *addgossip_done(struct command *cmd, { plugin_log(pay_plugin->plugin,LOG_DBG,"calling %s",__PRETTY_FUNCTION__); + /* This may free adg (pf is the parent), or otherwise it'll + * happen later. */ pay_flow_finished_adding_gossip(adg->pf); - tal_free(adg); return command_still_pending(cmd); }