CID
1376152 (#1 of 1): Unchecked return value (CHECKED_RETURN).
check_return: Calling bt_ctf_field_type_structure_get_field_by_index
without checking return value (as is done elsewhere 23 out of 25 times).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
switch (type_id) {
case CTF_TYPE_STRUCT:
- bt_ctf_field_type_structure_get_field_by_index(field_type,
- NULL, &field, index);
+ {
+ int ret = bt_ctf_field_type_structure_get_field_by_index(
+ field_type, NULL, &field, index);
+ if (ret) {
+ field = NULL;
+ goto end;
+ }
break;
+ }
case CTF_TYPE_VARIANT:
{
int ret = bt_ctf_field_type_variant_get_field_by_index(