From: Mathieu Desnoyers Date: Thu, 27 Jun 2013 21:32:37 +0000 (-0400) Subject: Fix: consumer double-close on error X-Git-Tag: v2.2.1~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f1dab979da8fc9a7ad198d84ef9fc18b60d5f8de;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 540c59f40..1dcc52c6a 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -3168,6 +3168,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; @@ -3213,6 +3214,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;