--- a/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c Thu Mar 29 08:52:41 2018 -0700
+++ b/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c Thu Mar 29 20:12:02 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -491,7 +491,9 @@
if (WSAGetLastError() == WSAEACCES) {
WSASetLastError(WSAEADDRINUSE);
}
+ (*env)->SetObjectField(env, this, pdsi_fdID, NULL);
NET_ThrowCurrent(env, "Cannot bind");
+ closesocket(fd);
return;
}
}