Fix: possible double-close on stream out_fd
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2013 22:37:35 +0000 (18:37 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 5 Jul 2013 15:08:14 +0000 (11:08 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/kernel-consumer/kernel-consumer.c

index fc869653da844c2238e89096e40a3750a52a4a9b..06801b9a1e8358439e483e9d6872e7bc78746719 100644 (file)
@@ -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;
This page took 0.025882 seconds and 4 git commands to generate.