X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=test%2Fparser%2Futils.c;h=6f78c2f93e36e8da2b117bd1ee94e64885e49fc2;hb=4dc604b496f388e6896d46bb02d109103c316e4f;hp=9a6b2e145061969eabaf62a9d96ebc72823825df;hpb=7d20772cc7b4d258ee878b4cb30b313f14502dc7;p=petitboot diff --git a/test/parser/utils.c b/test/parser/utils.c index 9a6b2e1..6f78c2f 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -32,6 +32,14 @@ void __register_parser(struct parser *parser) list_add(&parsers, &i->list); } +static void __attribute__((destructor)) __cleanup_parsers(void) +{ + struct p_item *item, *tmp; + + list_for_each_entry_safe(&parsers, item, tmp, list) + talloc_free(item); +} + static struct discover_device *test_create_device_simple( struct discover_context *ctx) {