mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
memleak: ignore tmpctx.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -100,6 +100,10 @@ static void children_into_htable(const void *exclude1, const void *exclude2,
|
|||||||
if (streq(name,
|
if (streq(name,
|
||||||
"ccan/ccan/io/poll.c:40:struct pollfd[]"))
|
"ccan/ccan/io/poll.c:40:struct pollfd[]"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Don't add tmpctx. */
|
||||||
|
if (streq(name, "tmpctx"))
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
htable_add(memtable, hash_ptr(i, NULL), i);
|
htable_add(memtable, hash_ptr(i, NULL), i);
|
||||||
children_into_htable(exclude1, exclude2, memtable, i);
|
children_into_htable(exclude1, exclude2, memtable, i);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len)
|
|||||||
/* Initial creation of tmpctx. */
|
/* Initial creation of tmpctx. */
|
||||||
void setup_tmpctx(void)
|
void setup_tmpctx(void)
|
||||||
{
|
{
|
||||||
tmpctx = tal(NULL, char);
|
tmpctx = tal_alloc_(NULL, 0, false, false, "tmpctx");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free any children of tmpctx. */
|
/* Free any children of tmpctx. */
|
||||||
@@ -40,6 +40,6 @@ void clean_tmpctx(void)
|
|||||||
/* Minor optimization: don't do anything if tmpctx unused. */
|
/* Minor optimization: don't do anything if tmpctx unused. */
|
||||||
if (tal_first(tmpctx)) {
|
if (tal_first(tmpctx)) {
|
||||||
tal_free(tmpctx);
|
tal_free(tmpctx);
|
||||||
tmpctx = tal(NULL, char);
|
tmpctx = tal_alloc_(NULL, 0, false, false, "tmpctx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user