]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
we don't really need a fixup pool
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Aug 2019 18:43:17 +0000 (14:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 Aug 2019 18:44:31 +0000 (14:44 -0400)
the fixups are few and far between.

src/lib/util/dict.c

index bdb6d777d4e43a634dfe8a9e6a2f4c48c65046e5..f9c7d25e6b5ad39744addc47bd9c438794247587 100644 (file)
@@ -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) {