mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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 <rusty@rustcorp.com.au>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user