Bug 1325858 - Redundant handles open for HKLM\SYSTEM\ControlSet001\Control\TimeZoneInformation r=andrebargull

This commit is contained in:
Robert Longson 2016-12-30 16:36:05 +00:00
Родитель f5651bd75d
Коммит a88f01d23a
3 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,26 @@
getTZKeyName in common/wintz.cpp leaks registry handle.
https://ssl.icu-project.org/trac/ticket/12908
diff --git a/intl/icu/source/common/wintz.c b/intl/icu/source/common/wintz.c
--- a/intl/icu/source/common/wintz.c
+++ b/intl/icu/source/common/wintz.c
@@ -211,16 +211,18 @@ static LONG getTZKeyName(char* tzKeyName
hkey,
"TimeZoneKeyName",
NULL,
NULL,
(LPBYTE)tzKeyName,
&cbData);
}
+ RegCloseKey(hkey);
+
return result;
}
/*
This code attempts to detect the Windows time zone, as set in the
Windows Date and Time control panel. It attempts to work on
multiple flavors of Windows (9x, Me, NT, 2000, XP) and on localized
installs. It works by directly interrogating the registry and

Просмотреть файл

@ -216,6 +216,8 @@ static LONG getTZKeyName(char* tzKeyName, int32_t length) {
&cbData);
}
RegCloseKey(hkey);
return result;
}

Просмотреть файл

@ -61,6 +61,7 @@ for patch in \
bug-1172609-timezone-recreateDefault.diff \
bug-1198952-workaround-make-3.82-bug.diff \
bug-1228227-bug-1263325-libc++-gcc_hidden.diff \
bug-1325858-close-key.diff \
ucol_getKeywordValuesForLocale-ulist_resetList.diff \
unum_formatDoubleForFields.diff \
; do