summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorMarc VanHeyningen <marc.vanheyningen@isilon.com>2008-03-14 14:26:28 -0800
committerVolker Lendecke <vl@samba.org>2008-03-17 20:52:25 +0100
commite06aa46b9fab1e107fea8f6453fb13deffa91e96 (patch)
treedb972999f1b17db3e6b100fec70b5f4643632172 /source3/nsswitch
parent6274929b1e1ddf89f4c5e93414121eaf06b6ab14 (diff)
downloadsamba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.gz
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.bz2
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.zip
Coverity fixes
(This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wins.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c
index e74cfaf69f..36415c42b5 100644
--- a/source3/nsswitch/wins.c
+++ b/source3/nsswitch/wins.c
@@ -58,9 +58,15 @@ static int wins_lookup_open_socket_in(void)
if (res == -1)
return -1;
- setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val));
+ if (setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val)) != 0) {
+ close(res);
+ return -1;
+ }
#ifdef SO_REUSEPORT
- setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val));
+ if (setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val)) != 0) {
+ close(res);
+ return -1;
+ }
#endif /* SO_REUSEPORT */
/* now we've got a socket - we need to bind it */