spender: free up vars to avoid transient false leak reports.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-03-22 19:18:13 +10:30
parent fdd7c6b192
commit 915a591873
2 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,9 @@ json_fundchannel(struct command *cmd,
if (utxos)
json_add_tok(req->js, "utxos", utxos, buf);
/* Stop memleak from complaining */
tal_free(id);
return send_outreq(cmd->plugin, req);
}

View File

@ -1931,6 +1931,13 @@ param_destinations_array(struct command *cmd, const char *name,
dest->request_amt = *request_amt;
dest->rates = tal_steal(*dests, rates);
/* Stop leak detection from complaining. */
tal_free(id);
tal_free(amount);
tal_free(push_msat);
tal_free(request_amt);
tal_free(announce);
/* Only one destination can have "all" indicator. */
if (dest->all) {
if (has_all)
@ -2028,6 +2035,9 @@ json_multifundchannel(struct command *cmd,
mfc->sigs_collected = false;
/* Stop memleak from complaining */
tal_free(minconf);
return perform_multifundchannel(mfc);
}