diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 61e4917c7824..9bee17ff31fb 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -851,6 +851,10 @@ int main(int argc, char *argv[]) free_unreleased_txs(ld->wallet); db_commit_transaction(ld->wallet->db); + /* Clean our our HTLC maps, since they use malloc. */ + htlc_in_map_clear(&ld->htlcs_in); + htlc_out_map_clear(&ld->htlcs_out); + remove(ld->pidfile); /* FIXME: pay can have children off tmpctx which unlink from