From: Alan T. DeKok Date: Sun, 10 Sep 2023 13:02:01 +0000 (-0400) Subject: we have talloc_const_free(), so just use that X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=909a1f9d15e0c6f1fbb1151fbf68dec3e0358f33;p=thirdparty%2Ffreeradius-server.git we have talloc_const_free(), so just use that --- diff --git a/src/lib/util/dict_unknown.c b/src/lib/util/dict_unknown.c index fcf82f76ebe..3695c58539e 100644 --- a/src/lib/util/dict_unknown.c +++ b/src/lib/util/dict_unknown.c @@ -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.