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.3.0-rc1~74 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2f225ce2a30ad1172d65f77409aadf102825f50b;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 a6306291a..0ac3942d2 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -956,11 +956,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;