lightningd: add notleak annotations.

We have things which we don't keep a pointer to, but aren't leaks.
Some are simply eternal (eg. listening sockets), others cases are
io_conn tied to the lifetime of an fd, and timers which expire.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-12-15 20:52:57 +10:30
committed by Christian Decker
parent 6c951bf7e0
commit ccb7047291
3 changed files with 14 additions and 6 deletions

View File

@@ -16,6 +16,7 @@
#include <ccan/tal/str/str.h>
#include <ccan/tal/tal.h>
#include <common/json.h>
#include <common/memleak.h>
#include <common/utils.h>
#include <errno.h>
#include <inttypes.h>
@@ -176,7 +177,8 @@ static void next_bcli(struct bitcoind *bitcoind)
fatal("%s exec failed: %s", bcli->args[0], strerror(errno));
bitcoind->req_running = true;
conn = io_new_conn(bitcoind, bcli->fd, output_init, bcli);
/* This lifetime is attached to bitcoind command fd */
conn = notleak(io_new_conn(bitcoind, bcli->fd, output_init, bcli));
io_set_finish(conn, bcli_finished, bcli);
}