* pflocal/socker.c (S_socket_connect): fix redundant call to
pthread_mutex_unlock. There is no need to hold sock->lock to call
connq_connect_cancel, and sock->lock must be taken when leaving the if/else
blocks.

Signed-off-by: Cyril Roelandt <tipec...@gmail.com>
---
 pflocal/socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pflocal/socket.c b/pflocal/socket.c
index 46749fe..65da748 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -139,11 +139,11 @@ S_socket_connect (struct sock_user *user, struct addr 
*addr)
                        sock_free (server);
                    }
 
-                 pthread_mutex_lock (&sock->lock);
                  if (err)
                    connq_connect_cancel (peer->listen_queue);
                }
 
+              pthread_mutex_lock (&sock->lock);
              /* We must set CONNECT_QUEUE to NULL, as no one else can
                 set it until we've done so.  */
              sock->connect_queue = NULL;
-- 
1.7.10.4


Reply via email to