From b695ccc3e351e589efd30b5ac420bac09d7959d9 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 17 Dec 2012 00:51:27 +0100 Subject: Fix double call to pthread_mutex_unlock in S_socket_connect. * 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. --- pflocal/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pflocal') diff --git a/pflocal/socket.c b/pflocal/socket.c index 46749fee..65da7487 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; -- cgit v1.2.3