Fix: consumer double-close on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 27 Jun 2013 21:32:37 +0000 (17:32 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 28 Jun 2013 14:58:27 +0000 (10:58 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/consumer.c

index 0565f54dfad4da97503a6eb6575e4c51110edc32..5574c5f0e1d545691f6837d2d4100a10c2a59e48 100644 (file)
@@ -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;
This page took 0.028991 seconds and 4 git commands to generate.