switch (fr_dict_attr_ref_type(ref->type)) {
case FR_DICT_ATTR_REF_ALIAS:
- if (fr_dict_attr_add_initialised(da) < 0) {
- error:
- talloc_free(da);
- *da_p = NULL;
- return -1;
- }
-
/*
* IF the ref exists, we can always add it. The ref won't be changed later.
*/
if (dict_protocol_reference(&src, da->parent, ref->unresolved) < 0) return -1;
- if (src) {
- if (dict_attr_ref_set(*da_p, src, FR_DICT_ATTR_REF_ALIAS) < 0) return -1;
- break;
+ if (src && (dict_attr_ref_set(*da_p, src, FR_DICT_ATTR_REF_ALIAS) < 0)) return -1;
+
+ if (fr_dict_attr_add_initialised(da) < 0) {
+ error:
+ talloc_free(da);
+ *da_p = NULL;
+ return -1;
}
- if (dict_fixup_group_enqueue(fixup, da, ref->unresolved) < 0) return -1;
+ if (!src && (dict_fixup_group_enqueue(fixup, da, ref->unresolved) < 0)) return -1;
ret = 1;
break;