Fix: FD leak in liblttng-ust-ctl
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 7 Feb 2014 16:54:06 +0000 (11:54 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 7 Feb 2014 16:55:29 +0000 (11:55 -0500)
Make sure wait/wakeup stream and channel FDs are closed at teardown.
This led to FD leaks on the consumer daemon when the relay daemon
disconnects unexpectedly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-ctl/ustctl.c

index 28dee5e9cdf80118113f53522dc296460f66b1af..965c700bc225b0d82201b3627fb9c6b002cb658d 100644 (file)
@@ -977,6 +977,8 @@ chan_error:
 
 void ustctl_destroy_channel(struct ustctl_consumer_channel *chan)
 {
+       (void) ustctl_channel_close_wait_fd(chan);
+       (void) ustctl_channel_close_wakeup_fd(chan);
        chan->chan->ops->channel_destroy(chan->chan);
        free(chan);
 }
@@ -1185,6 +1187,8 @@ void ustctl_destroy_stream(struct ustctl_consumer_stream *stream)
        assert(stream);
        buf = stream->buf;
        consumer_chan = stream->chan;
+       (void) ustctl_stream_close_wait_fd(stream);
+       (void) ustctl_stream_close_wakeup_fd(stream);
        lib_ring_buffer_release_read(buf, consumer_chan->chan->handle);
        free(stream);
 }
This page took 0.02504 seconds and 4 git commands to generate.