6987461: Handle leak when enabling java.net.useSystemProxies
authorchegar
Wed, 29 Sep 2010 17:33:17 +0100
changeset 6689 f34359d2e987
parent 6688 74c17eb999d2
child 6691 7e7d18be1370
6987461: Handle leak when enabling java.net.useSystemProxies Summary: Release the registry key handle if ProxyEnable is 0 Reviewed-by: michaelm
jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c
--- a/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c	Wed Sep 29 15:26:59 2010 +0800
+++ b/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c	Wed Sep 29 17:33:17 2010 +0100
@@ -250,6 +250,10 @@
           return proxy;
         }
       }
+    } else {
+      /* ProxyEnable == 0 or Query failed      */
+      /* close the handle to the registry key  */
+      RegCloseKey(hKey);
     }
   }