# HG changeset patch # User Matti Hamalainen # Date 1587937474 -10800 # Node ID 905d30063e4558ae8c3a9cd4426a23ce5f5a536d # Parent a34715d51ea4179ab22d8ed80431d821982c349e Use the th_cfg_free() deallocator. diff -r a34715d51ea4 -r 905d30063e45 tests.c --- a/tests.c Mon Apr 27 00:44:15 2020 +0300 +++ b/tests.c Mon Apr 27 00:44:34 2020 +0300 @@ -389,9 +389,17 @@ } -void test_config_free(th_llist_t *node) +void test_config_free(th_cfgitem_t *node) { - th_free_r(&node->data); + switch (node->type) + { + case ITEM_STRING: + th_free(*(node->v.val_str)); + break; + + case ITEM_STRING_LIST: + break; + } } @@ -472,7 +480,7 @@ test_result(&ctx, th_llist_find_func(*plist, nostr, test_config_strcmp) == NULL); test_end(&ctx); - th_llist_free_func_node(*plist, test_config_free); + th_llist_free_func_data(*plist, th_free); *plist = NULL; } @@ -559,9 +567,8 @@ out: // Free the data for v_str_list th_io_close(fh); - th_llist_free_func_node(v_str_list, test_config_free); - v_str_list = NULL; - th_cfg_free(cfg); + th_llist_free_func_data(v_str_list, th_free); + th_cfg_free(cfg, test_config_free); }