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:
parent
0a11a06dc9
commit
95a043e0eb
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user