JDK-4792008 : getXPStylePropFromReg(....) needs to close the handle
Type:Bug
Component:client-libs
Sub-Component:java.awt
Affected Version:1.4.2
Priority:P4
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2002-12-11
Updated:2003-03-14
Resolved:2003-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
This bug is valid only for 1.4.2 (mantis) & above.
Comments
CONVERTED DATA
BugTraq+ Release Management Values
COMMIT TO FIX:
tiger
FIXED IN:
tiger
INTEGRATED IN:
tiger
tiger-b03
14-06-2004
SUGGESTED FIX
In the file
j2se/src/windows/native/sun/windows/awt_DesktopProperties.cpp
Function getXPStylePropFromReg(...) does not close the Key before the return
The code which has to be added is marked with "<-------" below.
static char* getXPStylePropFromReg(char* valueName) {
char* subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager";
HKEY handle;
if (RegOpenKeyEx(HKEY_CURRENT_USER, subKey, 0, KEY_READ, &handle) != 0) {
return NULL;
}
DWORD valueType, valueSize;
if (RegQueryValueEx((HKEY)handle, valueName, NULL,
&valueType, NULL, &valueSize) != 0) {
RegCloseKey(handle); <---------- Needs to be added
return NULL;
}
char *buffer = (char*)safe_Malloc(valueSize);
if (RegQueryValueEx((HKEY)handle, valueName, NULL,
&valueType, (unsigned char *)buffer, &valueSize) != 0) {
free(buffer);
RegCloseKey(handle); <--------- Needs to be added
return NULL;
}
RegCloseKey(handle);
11-06-2004
EVALUATION
This bug is valid only for 1.4.2 (mantis) & above because CTE has already
put the fix into update releases of hopper and merlin.
Commit to fix in mantis (CTE).
###@###.### 2002-12-11
Filed because of escalation 4781104.
###@###.### 2002-12-13
Minor issue. Delaying until Tiger.
###@###.### 2002-12-16