Fix: miscellaneous memory handling fixes
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 34344f4518eeff43b6bd73675bf906635f0531b5..07073260f3262bb3cbd2207a846e3404fcf0713c 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:
@@ -2211,6 +2212,8 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
        assert(channel);
        assert(channel->metadata_cache);
 
+       memset(&request, 0, sizeof(request));
+
        /* send the metadata request to sessiond */
        switch (consumer_data.type) {
        case LTTNG_CONSUMER64_UST:
This page took 0.024085 seconds and 4 git commands to generate.