From e75c3b320b6414a28b274e2e755904ea6b45f35a Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 26 May 2014 14:12:23 -0400 Subject: [PATCH] Fix: possible use after free in consumer Fixes the coverity issue 1019959. Signed-off-by: David Goulet --- src/common/consumer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/consumer.c b/src/common/consumer.c index aacabdb76..e11e46077 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1308,6 +1308,10 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) DBG("Consumer destroying it. Closing everything."); + if (!ctx) { + return; + } + destroy_data_stream_ht(data_ht); destroy_metadata_stream_ht(metadata_ht); -- 2.34.1