Fix debug-info leak: unbalanced get/put
[babeltrace.git] / plugins / lttng-utils / copy.c
index 14cc12742113df5b7b65fc9051120bfea3149147..385d55c46027c8cba7801494ccfa55cb3c55ab56 100644 (file)
@@ -1055,10 +1055,9 @@ struct bt_ctf_packet *debug_info_new_packet(
                                __func__, __FILE__, __LINE__);
                goto error;
        }
-       bt_get(writer_packet);
 
        writer_packet_context = ctf_copy_packet_context(debug_it->err, packet,
-                       writer_stream);
+                       writer_stream, 0);
        if (!writer_packet_context) {
                fprintf(debug_it->err, "[error] %s in %s:%d\n",
                                __func__, __FILE__, __LINE__);
@@ -1113,6 +1112,7 @@ struct bt_ctf_stream *debug_info_stream_end(struct debug_info_iterator *debug_it
                                __func__, __FILE__, __LINE__);
                goto end;
        }
+       bt_get(writer_stream);
        g_hash_table_remove(debug_it->stream_map, stream);
 
 end:
This page took 0.022471 seconds and 4 git commands to generate.