]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't free da after it was added to the dictionaries
authorAlan T. DeKok <aland@freeradius.org>
Tue, 17 Feb 2026 00:14:15 +0000 (19:14 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 17 Feb 2026 00:25:50 +0000 (19:25 -0500)
src/lib/util/dict_tokenize.c

index f720ca51b73347a0f4a199111ff2dce2650cbed7..bd53204f6b057ab0607c01ab6aa110326d61f67a 100644 (file)
@@ -1728,7 +1728,7 @@ static int dict_read_process_attribute(dict_tokenize_ctx_t *dctx, char **argv, i
                 *      the VALUE also contains a pointer to the child struct.
                 */
                if (key && (dict_attr_enum_add_name(fr_dict_attr_unconst(key), da->name, &box, false, true, da) < 0)) {
-                       goto error;
+                       return -1;      /* Leaves attr added */
                }
 
                /*
@@ -1761,7 +1761,7 @@ static int dict_read_process_attribute(dict_tokenize_ctx_t *dctx, char **argv, i
                fr_assert(parent->parent);
 
                if (dict_attr_alias_add(parent->parent, da->name, da, false) < 0) {
-                       goto error;
+                       return -1;      /* Leaves attr added */
                }
        }
 
@@ -1980,8 +1980,7 @@ static int dict_read_process_begin_vendor(dict_tokenize_ctx_t *dctx, char **argv
                }
 
                if (dict_attr_add_to_namespace(UNCONST(fr_dict_attr_t *, vsa_da), new) < 0) {
-                       talloc_free(new);
-                       return -1;
+                       return -1; /* leaves attr added */
                }
 
                vendor_da = new;