summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2018-10-26 15:44:53 +0530
committerAndreas Schneider <asn@samba.org>2018-10-29 20:31:43 +0100
commit32df6eb3c0d6ef19f561ff65e444b3ce3dff5a9e (patch)
tree0f49aad319526d53d3f900cf1ce30c13e745a174
parentc26835ad5b0165efe51535b9e11c9d7282eca4b2 (diff)
downloadsocket_wrapper-32df6eb3c0d6ef19f561ff65e444b3ce3dff5a9e.tar.gz
socket_wrapper-32df6eb3c0d6ef19f561ff65e444b3ce3dff5a9e.tar.xz
socket_wrapper-32df6eb3c0d6ef19f561ff65e444b3ce3dff5a9e.zip
swrap: Fix coverity issues
CID 184220 CID 184221 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--src/socket_wrapper.c6
1 files 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;
}