- return bt_field_type_common_variant_get_field_by_index((void *) ft,
- field_name, (void *) field_type, index);
+ int ret = bt_field_type_common_variant_borrow_field_by_index(
+ (void *) ft, field_name, (void *) field_type, index);
+
+ if (ret == 0 && field_type) {
+ bt_get(*field_type);
+ }
+
+ return ret;