From 1eb484d4b471c2c040df42a6566cc0805efc071a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 24 Jan 2008 16:12:42 +0100 Subject: Fix Coverity ID 454 (This used to be commit 902d1d6709e47fbc8b538f28cb4364b006c431f8) --- source3/nmbd/nmbd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 344831ddca..378b6f3dbe 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -676,11 +676,18 @@ static bool open_sockets(bool isdaemon, int port) ClientNMB = 0; } + if (ClientNMB == -1) { + return false; + } + ClientDGRAM = open_socket_in(SOCK_DGRAM, DGRAM_PORT, 3, &ss, true); - if (ClientNMB == -1) { + if (ClientDGRAM == -1) { + if (ClientNMB != 0) { + close(ClientNMB); + } return false; } -- cgit