From 4957921e02b30e4b55e8d281e0a12d9fc27179c5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 15 Dec 2017 20:59:03 +1030 Subject: [PATCH] log: mark ltmp as notleak. Signed-off-by: Rusty Russell --- lightningd/log.c | 5 +++-- wallet/test/run-db.c | 3 +++ wallet/test/run-wallet.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lightningd/log.c b/lightningd/log.c index d11b78834..6b731ad41 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -112,7 +113,7 @@ struct log_book *new_log_book(const tal_t *ctx, /* In case ltmp not initialized, do so now. */ if (!ltmp) - ltmp = tal(lr, char); + ltmp = notleak(tal(lr, char)); return lr; } @@ -195,7 +196,7 @@ static void add_entry(struct log *log, struct log_entry *l) /* Free up temporaries now if any */ if (tal_first(ltmp)) { tal_free(ltmp); - ltmp = tal(log->lr, char); + ltmp = notleak(tal(log->lr, char)); } } diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index a21b78303..88673fc1b 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -15,6 +15,9 @@ static void db_fatal(const char *fmt, ...); /* Generated stub for memleak_scan_region */ void memleak_scan_region(struct htable *memtable UNNEEDED, const void *p UNNEEDED) { fprintf(stderr, "memleak_scan_region called!\n"); abort(); } +/* Generated stub for notleak_ */ +void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +{ fprintf(stderr, "notleak_ called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ static char *db_err; diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 48aac9029..39e57ecc9 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -19,6 +19,9 @@ static void wallet_fatal(const char *fmt, ...); /* Generated stub for memleak_scan_region */ void memleak_scan_region(struct htable *memtable UNNEEDED, const void *p UNNEEDED) { fprintf(stderr, "memleak_scan_region called!\n"); abort(); } +/* Generated stub for notleak_ */ +void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +{ fprintf(stderr, "notleak_ called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ static char *wallet_err;