From ae0cccb2939be2de972ec6cffbc4c492974789f8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Jul 2020 06:18:44 +0930 Subject: [PATCH] wallet: fix memleak if we get shut down before finishing utxo cleanup. "backtrace": [ "ccan/ccan/tal/tal.c:442 (tal_alloc_)", "wallet/wallet.c:154 (wallet_stmt2output)", "wallet/wallet.c:275 (wallet_get_utxos)", "wallet/wallet.c:3792 (wallet_clean_utxos)", "lightningd/lightningd.c:914 (main)" ], "label": "wallet/wallet.c:154:struct utxo", "parents": [ "wallet/wallet.c:273:struct utxo*[]" ], "value": "0x24c1be8" Signed-off-by: Rusty Russell --- wallet/wallet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wallet/wallet.c b/wallet/wallet.c index bba6704b1..4db76a1e6 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -3768,7 +3768,8 @@ void wallet_clean_utxos(struct wallet *w, struct bitcoind *bitcoind) if (tal_count(utxos) != 0) { bitcoind_getutxout(bitcoind, &utxos[0]->txid, utxos[0]->outnum, - process_utxo_result, notleak(utxos)); + process_utxo_result, + notleak_with_children(utxos)); } else tal_free(utxos); }