mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-12908 getTZKeyName in common/wintz.cpp leaks registry handle
We should only call RegCloseKey if we were actually able to open the key. (The value of hkey isn't explicitly initialized, so we could possibly be calling RegCloseKey with random data.) X-SVN-Rev: 39556
This commit is contained in:
parent
645b425d97
commit
40f9b33eb7
1 changed files with 4 additions and 8 deletions
|
@ -165,11 +165,9 @@ static LONG getTZI(const char *winid, TZI *tzi)
|
|||
NULL,
|
||||
(LPBYTE)tzi,
|
||||
&cbData);
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
RegCloseKey(hkey);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -187,11 +185,9 @@ static LONG getSTDName(const char *winid, char *regStdName, int32_t length) {
|
|||
NULL,
|
||||
(LPBYTE)regStdName,
|
||||
&cbData);
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
RegCloseKey(hkey);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -214,9 +210,9 @@ static LONG getTZKeyName(char* tzKeyName, int32_t length) {
|
|||
NULL,
|
||||
(LPBYTE)tzKeyName,
|
||||
&cbData);
|
||||
}
|
||||
|
||||
RegCloseKey(hkey);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue