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:09:59 +0000 (11:09 -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 a6306291af17f153a35c56aa300a4bd51c3ed03b..0ac3942d20470b6112351cb11bd908d9b6a44bcf 100644 (file)
@@ -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;
This page took 0.027294 seconds and 4 git commands to generate.