winpr/winsock: Fix leak found by covscan

0 is valid return value from socket().

leaked_handle: Handle variable "fd" going out of scope leaks the handle.
This commit is contained in:
Ondrej Holy 2018-08-20 11:11:47 +02:00
parent 0a11a06dc9
commit 95a043e0eb

View File

@ -1225,7 +1225,7 @@ SOCKET _socket(int af, int type, int protocol)
SOCKET s;
fd = socket(af, type, protocol);
if (fd < 1)
if (fd < 0)
return INVALID_SOCKET;
s = (SOCKET) fd;