Browse Source

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>
paymod-02
Rusty Russell 5 years ago
parent
commit
ae0cccb293
  1. 3
      wallet/wallet.c

3
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);
}

Loading…
Cancel
Save