diff --git a/reactos/dll/win32/ws2_32/src/sockctrl.c b/reactos/dll/win32/ws2_32/src/sockctrl.c index 1bf9e821249..2414b032315 100644 --- a/reactos/dll/win32/ws2_32/src/sockctrl.c +++ b/reactos/dll/win32/ws2_32/src/sockctrl.c @@ -236,6 +236,9 @@ getsockname(IN SOCKET s, } else { + /* Deference the Socket Context */ + WsSockDereference(Socket); + /* name or namelen not valid */ ErrorCode = WSAEFAULT; } diff --git a/reactos/dll/win32/ws2_32/src/socklife.c b/reactos/dll/win32/ws2_32/src/socklife.c index 50f559f498d..5b14364f550 100644 --- a/reactos/dll/win32/ws2_32/src/socklife.c +++ b/reactos/dll/win32/ws2_32/src/socklife.c @@ -66,6 +66,9 @@ bind(IN SOCKET s, } else { + /* Deference the Socket Context */ + WsSockDereference(Socket); + /* name or namelen not valid */ ErrorCode = WSAEFAULT; }