mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common: enforce that we have collected all wally allocations.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -81,11 +81,20 @@ void send_backtrace(const char *why)
|
|||||||
int daemon_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
int daemon_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
||||||
{
|
{
|
||||||
const char *t;
|
const char *t;
|
||||||
|
char *wally_leak;
|
||||||
|
|
||||||
t = taken_any();
|
t = taken_any();
|
||||||
if (t)
|
if (t)
|
||||||
errx(1, "Outstanding taken pointers: %s", t);
|
errx(1, "Outstanding taken pointers: %s", t);
|
||||||
|
|
||||||
|
wally_leak = tal_first(wally_tal_ctx);
|
||||||
|
if (wally_leak) {
|
||||||
|
/* Trigger valgrind to tell us about this! */
|
||||||
|
tal_free(wally_leak);
|
||||||
|
*wally_leak = 0;
|
||||||
|
errx(1, "Outstanding wally allocations");
|
||||||
|
}
|
||||||
|
|
||||||
clean_tmpctx();
|
clean_tmpctx();
|
||||||
|
|
||||||
return poll(fds, nfds, timeout);
|
return poll(fds, nfds, timeout);
|
||||||
|
|||||||
Reference in New Issue
Block a user