Fix: memory/fd leak when cleaning streams in channel
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 34344f4518eeff43b6bd73675bf906635f0531b5..b48a3c821d386fbf3cbfaceb8b01d9bbcc4f724d 100644 (file)
@@ -749,8 +749,9 @@ error:
         * the stream is still in the local stream list of the channel. This call
         * will make sure to clean that list.
         */
-       cds_list_del(&metadata->metadata_stream->send_node);
        consumer_stream_destroy(metadata->metadata_stream, NULL);
+       cds_list_del(&metadata->metadata_stream->send_node);
+       metadata->metadata_stream = NULL;
 error_no_stream:
 end:
        return ret;
@@ -842,8 +843,8 @@ error_stream:
         * Clean up the stream completly because the next snapshot will use a new
         * metadata stream.
         */
-       cds_list_del(&metadata_stream->send_node);
        consumer_stream_destroy(metadata_stream, NULL);
+       cds_list_del(&metadata_stream->send_node);
        metadata_channel->metadata_stream = NULL;
 
 error:
This page took 0.023156 seconds and 4 git commands to generate.