Fix: possible use after free in consumer
[lttng-tools.git] / src / common / consumer.c
index e80ac6be751fbba7eebc98404d520f9ea62c4cd5..999e400059fbe763264698a75c67b3fb80d6c717 100644 (file)
@@ -34,6 +34,7 @@
 #include <common/common.h>
 #include <common/utils.h>
 #include <common/compat/poll.h>
+#include <common/compat/endian.h>
 #include <common/index/index.h>
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/sessiond-comm/relayd.h>
@@ -1403,6 +1404,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);
 
This page took 0.024031 seconds and 4 git commands to generate.