From: Mathieu Desnoyers Date: Thu, 27 Jun 2013 21:32:37 +0000 (-0400) Subject: Fix: consumer double-close on error X-Git-Tag: v2.3.0-rc1~96 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4b29f1cec9f8e93d4dde0c982f30e3201f0f4e65;p=lttng-tools.git Fix: consumer double-close on error Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 0565f54df..5574c5f0e 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -3107,6 +3107,7 @@ int consumer_add_relayd_socket(int net_seq_idx, int sock_type, /* Assign new file descriptor */ relayd->control_sock.sock.fd = fd; + fd = -1; /* For error path */ /* Assign version values. */ relayd->control_sock.major = relayd_sock->major; relayd->control_sock.minor = relayd_sock->minor; @@ -3152,6 +3153,7 @@ int consumer_add_relayd_socket(int net_seq_idx, int sock_type, /* Assign new file descriptor */ relayd->data_sock.sock.fd = fd; + fd = -1; /* for eventual error paths */ /* Assign version values. */ relayd->data_sock.major = relayd_sock->major; relayd->data_sock.minor = relayd_sock->minor;