src.ctf.fs: use "borrow" functions where possible
[babeltrace.git] / plugins / ctf / common / utils / utils.c
index 70261f91682262923a791cef822bbb9c1b8507ea..10662a80c8881803cba65251d648645989fc42ec 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "utils.h"
 
-struct bt_stream_class *ctf_utils_stream_class_from_packet_header(
+struct bt_stream_class *ctf_utils_borrow_stream_class_from_packet_header(
                struct bt_trace *trace,
                struct bt_field *packet_header_field)
 {
@@ -40,7 +40,7 @@ struct bt_stream_class *ctf_utils_stream_class_from_packet_header(
                goto single_stream_class;
        }
 
-       stream_id_field = bt_field_structure_get_field_by_name(
+       stream_id_field = bt_field_structure_borrow_field_by_name(
                packet_header_field, "stream_id");
        if (!stream_id_field) {
                goto single_stream_class;
@@ -59,13 +59,12 @@ single_stream_class:
                        goto end;
                }
 
-               stream_class = bt_trace_get_stream_class_by_index(trace, 0);
+               stream_class = bt_trace_borrow_stream_class_by_index(trace, 0);
        } else {
-               stream_class = bt_trace_get_stream_class_by_id(trace,
+               stream_class = bt_trace_borrow_stream_class_by_id(trace,
                        stream_id);
        }
 
 end:
-       bt_put(stream_id_field);
        return stream_class;
 }
This page took 0.025161 seconds and 4 git commands to generate.