]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
da->parent may be NULL here, too.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 21 Dec 2021 21:48:22 +0000 (16:48 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 21 Dec 2021 21:48:22 +0000 (16:48 -0500)
we have fr_dict_unknown_attr_afrom_da() and fr_dict_unknown_afrom_da()
which are 90% identical.  Perhaps some common code would help.

src/lib/util/dict_unknown.c

index 7279893cc922363303b6efd41bad89ebfa9c0c85..6065587aeb688b1693e882d13c00d689b2567768 100644 (file)
@@ -197,7 +197,7 @@ fr_dict_attr_t *fr_dict_unknown_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *
         *      parents when this 'da' is freed.  We therefore talloc
         *      the parent from the 'da'.
         */
-       if (da->parent->flags.is_unknown) {
+       if (d->parent && da->parent->flags.is_unknown) {
                parent = fr_dict_unknown_afrom_da(n, da->parent);
                if (!parent) {
                        talloc_free(n);