From eda1150d775f6e572c4215b05ebe44fa454091f1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 4 Jul 2013 18:37:35 -0400 Subject: [PATCH 1/1] Fix: possible double-close on stream out_fd Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- src/common/kernel-consumer/kernel-consumer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index fc869653d..06801b9a1 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -582,11 +582,12 @@ int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream) return 0; error_close_fd: - { + if (stream->out_fd >= 0) { int err; err = close(stream->out_fd); assert(!err); + stream->out_fd = -1; } error: return ret; -- 2.34.1