]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
pass ref to dict alloc function
authorAlan T. DeKok <aland@freeradius.org>
Tue, 11 May 2021 12:28:53 +0000 (08:28 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 11 May 2021 12:28:53 +0000 (08:28 -0400)
src/lib/util/dict_tokenize.c

index 7a658ebe4cde7a45b70aeace59ba277c76a15ffb..fd8dbbfa58fd8af356605733cd3967be004388b3 100644 (file)
@@ -601,27 +601,11 @@ static int dict_read_process_alias(dict_tokenize_ctx_t *ctx, char **argv, int ar
         *      actually get returned "ref".
         */
        self = dict_attr_alloc(ctx->dict->pool, parent, argv[0], da->attr, da->type,
-                              &(dict_attr_args_t){ .flags = &da->flags });
+                              &(dict_attr_args_t){ .flags = &da->flags, .ref = da });
        if (unlikely(!self)) return -1;
 
        self->dict = ctx->dict;
 
-       /*
-        *      Allocate room for the reference.
-        */
-       if (dict_attr_ext_alloc(&self, FR_DICT_ATTR_EXT_REF) < 0) {
-               fr_strerror_const("Internal allocating reference");
-               goto error;
-       }
-
-       /*
-        *      Then set the reference.
-        */
-       if (dict_attr_ref_set(self, da) < 0) {
-               fr_strerror_const("Internal error storing reference");
-               goto error;
-       }
-
        fr_assert(fr_dict_attr_ref(self) == da);
 
        namespace = dict_attr_namespace(parent);