From f5a0c9cf497ccd3f438832072ff9c4c06264c16c Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 4 Jul 2013 14:57:06 -0400 Subject: [PATCH] Fix: destroy metadata stream on setup metadata error path Signed-off-by: David Goulet --- src/common/ust-consumer/ust-consumer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index f318af153..ff4ba25b9 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -726,7 +726,7 @@ static int setup_metadata(struct lttng_consumer_local_data *ctx, uint64_t key) if (cds_list_empty(&metadata->streams.head)) { ERR("Metadata channel key %" PRIu64 ", no stream available.", key); ret = LTTCOMM_CONSUMERD_ERROR_METADATA; - goto error; + goto error_no_stream; } /* Send metadata stream to relayd if needed. */ @@ -758,7 +758,9 @@ error: * the stream is still in the local stream list of the channel. This call * will make sure to clean that list. */ - consumer_del_channel(metadata); + cds_list_del(&metadata->metadata_stream->send_node); + consumer_stream_destroy(metadata->metadata_stream, NULL); +error_no_stream: end: return ret; } -- 2.34.1