X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=78b3f0799737139fc9067a601a39452e384b3e0e;hp=b5fe9831640217455c40c11b9e85e36b470ec05c;hb=73811eccc9599ebf62e5f5bee49039cecc25c3eb;hpb=f21dae485bbd4a21104eff49a80b59ce25054bc2 diff --git a/src/common/consumer.c b/src/common/consumer.c index b5fe98316..78b3f0799 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1960,6 +1960,13 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, } end: + /* + * Nullify the stream reference so it is not used after deletion. The + * consumer data lock MUST be acquired before being able to check for a + * NULL pointer value. + */ + stream->chan->metadata_stream = NULL; + pthread_mutex_unlock(&stream->lock); pthread_mutex_unlock(&consumer_data.lock);