# HG changeset patch # User chegar # Date 1285777997 -3600 # Node ID f34359d2e9874d6073bcd05edaee83107e446fad # Parent 74c17eb999d286fca28fb5b4d069fb83241eff9a 6987461: Handle leak when enabling java.net.useSystemProxies Summary: Release the registry key handle if ProxyEnable is 0 Reviewed-by: michaelm diff -r 74c17eb999d2 -r f34359d2e987 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); } }