Skip to content

Commit

Permalink
check return code
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Nov 13, 2024
1 parent ca7a458 commit 049df87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/util/dict_unknown.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ static fr_dict_attr_t *dict_unknown_alloc(TALLOC_CTX *ctx, fr_dict_attr_t const
if (da->parent && da->parent->flags.is_unknown) {
parent = fr_dict_attr_unknown_copy(n, da->parent);
if (!parent) {
error:
talloc_free(n);
return NULL;
}
Expand All @@ -212,7 +213,9 @@ static fr_dict_attr_t *dict_unknown_alloc(TALLOC_CTX *ctx, fr_dict_attr_t const
/*
* Initialize the rest of the fields.
*/
dict_attr_init(&n, parent, da->name, da->attr, type, &(dict_attr_args_t){ .flags = &flags });
if (dict_attr_init(&n, parent, da->name, da->attr, type, &(dict_attr_args_t){ .flags = &flags }) < 0) {
goto error;
}
if (type != FR_TYPE_OCTETS) dict_attr_ext_copy_all(&n, da);
DA_VERIFY(n);

Expand Down

0 comments on commit 049df87

Please sign in to comment.