From: David Goulet Date: Thu, 4 Jul 2013 18:57:06 +0000 (-0400) Subject: Fix: destroy metadata stream on setup metadata error path X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=f5a0c9cf497ccd3f438832072ff9c4c06264c16c Fix: destroy metadata stream on setup metadata error path Signed-off-by: David Goulet --- 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; }