]> git.ozlabs.org Git - petitboot/blobdiff - test/parser/utils.c
test/parser: Cleanup Makefile.am
[petitboot] / test / parser / utils.c
index 9a6b2e145061969eabaf62a9d96ebc72823825df..70a40bbd5b60b2ce40daf3fec41c09b0b5d03a32 100644 (file)
@@ -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)
 {
@@ -78,7 +86,7 @@ struct parser_test *test_init(void)
        struct parser_test *test;
 
        test = talloc_zero(NULL, struct parser_test);
-       test->handler = device_handler_init(NULL, 0);
+       test->handler = device_handler_init(NULL, NULL, 0);
        test->ctx = test_create_context(test);
 
        return test;