From 3773251d4ef72c60d1b3f0397d24e87c779b1432 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 16 Dec 2018 15:13:06 +1030 Subject: [PATCH] jsonrpc: mark all JSONRPC connections as notleak. Live connections can confuse us; this happens a lot more when we're running complex plugins, since they make JSONRPC connections while we're running our tests. Signed-off-by: Rusty Russell --- lightningd/jsonrpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 13d8c0bd7..123badf3c 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -430,7 +430,6 @@ void PRINTF_FMT(3, 4) command_fail(struct command *cmd, int code, void command_still_pending(struct command *cmd) { notleak_with_children(cmd); - notleak(cmd->jcon); cmd->pending = true; } @@ -694,7 +693,8 @@ static struct io_plan *jcon_connected(struct io_conn *conn, { struct json_connection *jcon; - jcon = tal(conn, struct json_connection); + /* We live as long as the connection, so we're not a leak. */ + jcon = notleak(tal(conn, struct json_connection)); jcon->conn = conn; jcon->ld = ld; jcon->used = 0;