comparison src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c @ 7940:b5bef1f71de6

8008804: file descriptor leak in src/windows/native/java/net/DualStackPlainSocketImpl.c Reviewed-by: alanb, chegar, dsamersoff
author jzavgren
date Tue, 05 Mar 2013 14:30:18 +0000
parents cea72c2bf071
children 11cdcf87ad5d a65111ce1ed7
comparison
equal deleted inserted replaced
3:6351cb9d269f 4:78a47ffe033d
87 } 87 }
88 88
89 rv = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &opt, sizeof(opt)); 89 rv = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &opt, sizeof(opt));
90 if (rv == SOCKET_ERROR) { 90 if (rv == SOCKET_ERROR) {
91 NET_ThrowNew(env, WSAGetLastError(), "Socket creation failed"); 91 NET_ThrowNew(env, WSAGetLastError(), "Socket creation failed");
92 closesocket(fd);
92 return -1; 93 return -1;
93 } 94 }
94 95
95 SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE); 96 SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE);
96 NET_SetSockOpt(fd, SOL_SOCKET, SO_BROADCAST, (char*)&t, sizeof(BOOL)); 97 NET_SetSockOpt(fd, SOL_SOCKET, SO_BROADCAST, (char*)&t, sizeof(BOOL));