From 32df6eb3c0d6ef19f561ff65e444b3ce3dff5a9e Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 26 Oct 2018 15:44:53 +0530 Subject: swrap: Fix coverity issues CID 184220 CID 184221 Signed-off-by: Anoop C S Reviewed-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- src/socket_wrapper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 0f19b95..5e3a47b 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -2055,8 +2055,6 @@ static void swrap_remove_stale(int fd) reset_socket_info_index(fd); - swrap_mutex_unlock(&socket_reset_mutex); - si = swrap_get_socket_info(si_index); swrap_mutex_lock(&first_free_mutex); @@ -2078,6 +2076,7 @@ static void swrap_remove_stale(int fd) out: SWRAP_UNLOCK_SI(si); swrap_mutex_unlock(&first_free_mutex); + swrap_mutex_unlock(&socket_reset_mutex); } static int sockaddr_convert_to_un(struct socket_info *si, @@ -5935,8 +5934,6 @@ static int swrap_close(int fd) reset_socket_info_index(fd); - swrap_mutex_unlock(&socket_reset_mutex); - si = swrap_get_socket_info(si_index); swrap_mutex_lock(&first_free_mutex); @@ -5970,6 +5967,7 @@ static int swrap_close(int fd) out: SWRAP_UNLOCK_SI(si); swrap_mutex_unlock(&first_free_mutex); + swrap_mutex_unlock(&socket_reset_mutex); return ret; } -- cgit