diff --git a/plugins/askrene/askrene.c b/plugins/askrene/askrene.c index 250c1aa0e49f..7dfa22a6f383 100644 --- a/plugins/askrene/askrene.c +++ b/plugins/askrene/askrene.c @@ -883,7 +883,9 @@ static const struct plugin_command commands[] = { static void askrene_markmem(struct plugin *plugin, struct htable *memtable) { - layer_memleak_mark(get_askrene(plugin), memtable); + struct askrene *askrene = get_askrene(plugin); + layer_memleak_mark(askrene, memtable); + reserve_memleak_mark(askrene, memtable); } static const char *init(struct plugin *plugin, diff --git a/plugins/askrene/reserve.c b/plugins/askrene/reserve.c index 27bd99526891..ca41b6f9aa94 100644 --- a/plugins/askrene/reserve.c +++ b/plugins/askrene/reserve.c @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include /* Hash table for reservations */ @@ -138,3 +140,8 @@ void reserves_clear_capacities(struct reserve_htable *reserved, capacities[idx] = 0; } } + +void reserve_memleak_mark(struct askrene *askrene, struct htable *memtable) +{ + memleak_scan_htable(memtable, &askrene->reserved->raw); +} diff --git a/plugins/askrene/reserve.h b/plugins/askrene/reserve.h index 97ebc5808dee..7da617229c56 100644 --- a/plugins/askrene/reserve.h +++ b/plugins/askrene/reserve.h @@ -40,4 +40,7 @@ size_t reserves_remove(struct reserve_htable *reserved, void reserves_clear_capacities(struct reserve_htable *reserved, const struct gossmap *gossmap, fp16_t *capacities); + +/* Scan for memleaks */ +void reserve_memleak_mark(struct askrene *askrene, struct htable *memtable); #endif /* LIGHTNING_PLUGINS_ASKRENE_RESERVE_H */