Fix: consumerd: use-after-free of metadata bucket
[lttng-tools.git] / src / common / consumer / consumer-stream.c
index 9f134e141b549f4e478faadaf15a64f58b83fc71..c334edb154dfa78a49fbfd3f2189f42011f40fad 100644 (file)
@@ -517,6 +517,8 @@ struct lttng_consumer_stream *consumer_stream_create(
                goto error;
        }
 
+       stream->send_node = (typeof(stream->send_node))
+                       CDS_LIST_HEAD_INIT(stream->send_node);
        stream->chan = channel;
        stream->key = stream_key;
        stream->trace_chunk = trace_chunk;
@@ -889,6 +891,8 @@ void consumer_stream_destroy(struct lttng_consumer_stream *stream,
 {
        assert(stream);
 
+       cds_list_del_init(&stream->send_node);
+
        /* Stream is in monitor mode. */
        if (stream->monitor) {
                struct lttng_consumer_channel *free_chan = NULL;
@@ -921,6 +925,7 @@ void consumer_stream_destroy(struct lttng_consumer_stream *stream,
                         * If the stream is not visible globally, this needs to be done
                         * outside of the consumer data lock section.
                         */
+                       destroy_close_stream(stream);
                        free_chan = unref_channel(stream);
                }
 
This page took 0.025101 seconds and 4 git commands to generate.