]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
we have talloc_const_free(), so just use that
authorAlan T. DeKok <aland@freeradius.org>
Sun, 10 Sep 2023 13:02:01 +0000 (09:02 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 10 Sep 2023 13:02:01 +0000 (09:02 -0400)
src/lib/util/dict_unknown.c

index fcf82f76ebe86731dc5813ab4e0370cc503f36d6..3695c58539ebd40f4f331aa5eb2a42cbbccaafe9 100644 (file)
@@ -147,8 +147,6 @@ fr_dict_attr_t const *fr_dict_unknown_add(fr_dict_t *dict, fr_dict_attr_t const
  */
 void fr_dict_unknown_free(fr_dict_attr_t const **da)
 {
-       fr_dict_attr_t **tmp;
-
        if (!da || !*da) return;
 
        /* Don't free real DAs */
@@ -156,10 +154,9 @@ void fr_dict_unknown_free(fr_dict_attr_t const **da)
                return;
        }
 
-       memcpy(&tmp, &da, sizeof(*tmp));
-       talloc_free(*tmp);
+       talloc_const_free(*da);
 
-       *tmp = NULL;
+       *da = NULL;
 }
 
 /**  Allocate an unknown DA.