]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Need to free the internal dictionary on reset
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Apr 2021 21:22:24 +0000 (22:22 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Apr 2021 21:22:24 +0000 (22:22 +0100)
src/bin/unit_test_attribute.c

index 50af376f7db9d07f7051c0ccedeac42620b8a3cc..c1f48dae3ab7b54bae4d77865ee1c853669399d4 100644 (file)
@@ -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,