From d14a67addf89085efdbe234f4baa7e3fb767eef3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 4 Nov 2016 11:17:05 +1030 Subject: [PATCH] db: fix leak for initial commit state. It's only a single cstate, but it need not outlive the commit. Signed-off-by: Rusty Russell --- daemon/db.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/db.c b/daemon/db.c index f979b3ef9..f4e1e1b95 100644 --- a/daemon/db.c +++ b/daemon/db.c @@ -506,13 +506,13 @@ static void load_peer_htlcs(struct peer *peer) fatal("load_peer_htlcs:prepare gave %s:%s", sqlite3_errstr(err), sqlite3_errmsg(sql)); - peer->local.commit->cstate = initial_cstate(peer, + peer->local.commit->cstate = initial_cstate(peer->local.commit, peer->anchor.satoshis, peer->local.commit_fee_rate, peer->local.offer_anchor == CMD_OPEN_WITH_ANCHOR ? LOCAL : REMOTE); - peer->remote.commit->cstate = initial_cstate(peer, + peer->remote.commit->cstate = initial_cstate(peer->remote.commit, peer->anchor.satoshis, peer->remote.commit_fee_rate, peer->local.offer_anchor