]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
*out may be NULL. CID #1503963
authorAlan T. DeKok <aland@freeradius.org>
Thu, 14 Apr 2022 15:04:39 +0000 (11:04 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 14 Apr 2022 15:04:39 +0000 (11:04 -0400)
src/lib/util/dict_unknown.c

index 3b3c29d0dbeb54deef546779349e3b0ae21b28bf..74f36e00cc096744c99f51fa2d71dcd6f784ef03 100644 (file)
@@ -450,8 +450,12 @@ ssize_t fr_dict_unknown_afrom_oid_substr(TALLOC_CTX *ctx,
        case FR_DICT_ATTR_OK:
                if (is_raw) {
                        *out = fr_dict_unknown_attr_afrom_da(ctx, our_parent);
-                       (*out)->flags.is_raw = 1;
-                       if (err) *err = *out ? FR_DICT_ATTR_OK : FR_DICT_ATTR_PARSE_ERROR;
+                       if (!*out) {
+                               if (err) *err = FR_DICT_ATTR_PARSE_ERROR;
+                       } else {
+                               (*out)->flags.is_raw = 1;
+                               if (err) *err = FR_DICT_ATTR_OK;
+                       }
                } else {
                        *out = fr_dict_attr_unconst(our_parent);        /* Which is the resolved attribute in this case */
                        if (err) *err = FR_DICT_ATTR_OK;