From: Alan T. DeKok Date: Wed, 14 Aug 2019 18:43:17 +0000 (-0400) Subject: we don't really need a fixup pool X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd4d6996b37a7c23bf61bf376115bcf6ce94bbbc;p=thirdparty%2Ffreeradius-server.git we don't really need a fixup pool the fixups are few and far between. --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index bdb6d777d4e..f9c7d25e6b5 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -42,7 +42,6 @@ RCSID("$Id$") #define MAX_ARGV (16) #define DICT_POOL_SIZE (1024 * 1024 * 2) -#define DICT_FIXUP_POOL_SIZE (1024 * 1024 * 1) static TALLOC_CTX *dict_ctx; static fr_hash_table_t *protocol_by_name = NULL; //!< Hash containing names of all the registered protocols. @@ -5172,14 +5171,6 @@ static int _dict_from_file(dict_from_file_ctx_t *ctx, goto error; } - /* - * Add a temporary fixup pool - * - * @todo - make a nested ctx? - */ - if (!ctx->fixup_pool) ctx->fixup_pool = talloc_pool(NULL, DICT_FIXUP_POOL_SIZE); - - // check if there's a linked library for the // protocol. The values can be unknown (we // try to load one), or non-existent, or @@ -5543,6 +5534,7 @@ static int dict_from_file(fr_dict_t *dict, ctx.dict = dict; ctx.stack[0].da = dict->root; ctx.stack[0].nest = FR_TYPE_MAX; + ctx.fixup_pool = talloc_init("fixup pool"); rcode = _dict_from_file(&ctx, dir_name, filename, src_file, src_line); @@ -5964,7 +5956,7 @@ int fr_dict_parse_str(fr_dict_t *dict, char *buf, fr_dict_attr_t const *parent) ctx.stack[0].da = dict->root; ctx.stack[0].nest = FR_TYPE_MAX; - ctx.fixup_pool = talloc_pool(NULL, DICT_FIXUP_POOL_SIZE); + ctx.fixup_pool = talloc_init("fixup pool"); if (!ctx.fixup_pool) return -1; if (strcasecmp(argv[0], "VALUE") == 0) {