From: Mathieu Desnoyers Date: Thu, 4 Jul 2013 22:37:35 +0000 (-0400) Subject: Fix: possible double-close on stream out_fd X-Git-Tag: v2.2.1~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=eda1150d775f6e572c4215b05ebe44fa454091f1;p=lttng-tools.git Fix: possible double-close on stream out_fd Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- 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;