From a901402e666854d5fb4d57b43ccf257514b80c8d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 26 Feb 2022 11:20:33 +1030 Subject: [PATCH] plugins/pay: fix unnecessary code. 1. p is a child of cmd, so it's freed by command_failed. 2. cltv_budget is set a few lines up to the same thing already. Signed-off-by: Rusty Russell --- plugins/pay.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/pay.c b/plugins/pay.c index 9c0b4dae7..bf5fc83f0 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -2476,12 +2476,10 @@ static struct command_result *json_paymod(struct command *cmd, if (!amount_msat_fee(&p->constraints.fee_budget, p->amount, 0, *maxfee_pct_millionths / 100)) { - tal_free(p); return command_fail( cmd, JSONRPC2_INVALID_PARAMS, "Overflow when computing fee budget, fee rate too high."); } - p->constraints.cltv_budget = *maxdelay; payment_mod_exemptfee_get_data(p)->amount = *exemptfee; shadow_route = payment_mod_shadowroute_get_data(p);