[WS2_32] Dereference socket in case of parameter check failure. Thanks Thomas. ROSTES...
authorPeter Hater <7element@mail.bg>
Thu, 25 May 2017 14:51:16 +0000 (14:51 +0000)
committerPeter Hater <7element@mail.bg>
Thu, 25 May 2017 14:51:16 +0000 (14:51 +0000)
svn path=/trunk/; revision=74652

reactos/dll/win32/ws2_32/src/sockctrl.c
reactos/dll/win32/ws2_32/src/socklife.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;
             }
index 50f559f..5b14364 100644 (file)
@@ -66,6 +66,9 @@ bind(IN SOCKET s,
             }
             else
             {
+                /* Deference the Socket Context */
+                WsSockDereference(Socket);
+
                 /* name or namelen not valid */
                 ErrorCode = WSAEFAULT;
             }