Skip to content

Commit bcb34b8

Browse files
Update windows.cpp
1 parent f0d75d4 commit bcb34b8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/cfg/windows.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ void invalid_socket()
5454
// cppcheck-suppress resourceLeak
5555
}
5656

57+
void invalid_socket_noleak(int a, int t, int p) { // #14155
58+
SOCKET s = socket(a, t, p);
59+
if (s == INVALID_SOCKET)
60+
return;
61+
closesocket(s);
62+
}
63+
5764
void resourceLeak_OpenThread(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwThreadId)
5865
{
5966
HANDLE proc = OpenThread(dwDesiredAccess, bInheritHandle, dwThreadId);

0 commit comments

Comments
 (0)