[WS2_32] Dereference socket in case of parameter check failure. Thanks Thomas. ROSTES...
[reactos.git] / reactos / dll / win32 / ws2_32 / src / sockctrl.c
index 1bf9e82..2414b03 100644 (file)
@@ -236,6 +236,9 @@ getsockname(IN SOCKET s,
             }
             else
             {
+                /* Deference the Socket Context */
+                WsSockDereference(Socket);
+
                 /* name or namelen not valid */
                 ErrorCode = WSAEFAULT;
             }