From: Arran Cudbard-Bell Date: Wed, 7 Apr 2021 21:22:24 +0000 (+0100) Subject: Need to free the internal dictionary on reset X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e376d7c328395f52f20f93d328d2e6d2ad6d6ee7;p=thirdparty%2Ffreeradius-server.git Need to free the internal dictionary on reset --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index 50af376f7d..c1f48dae3a 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -2688,8 +2688,16 @@ static void command_ctx_reset(command_file_ctx_t *cc, TALLOC_CTX *ctx) cc->tmp_ctx = talloc_named_const(ctx, 0, "tmp_ctx"); cc->test_count = 0; - fr_dict_global_ctx_free(cc->test_gctx); + if (fr_dict_free(&cc->test_internal_dict, __FILE__) < 0) { + fr_perror("unit_test_attribute"); + } + + if (fr_dict_global_ctx_free(cc->test_gctx) < 0) fr_perror("unit_test_attribute"); + cc->test_gctx = fr_dict_global_ctx_init(cc, cc->config->dict_dir); + if (fr_dict_internal_afrom_file(&cc->test_internal_dict, FR_DICTIONARY_INTERNAL_DIR, __FILE__) < 0) { + fr_perror("Failed loading test dict_gctx internal dictionary"); + } } static int process_file(bool *exit_now, TALLOC_CTX *ctx, command_config_t const *config,