Skip to content

Commit

Permalink
Bug 1325858 - Redundant handles open for HKLM\SYSTEM\ControlSet001\Co…
Browse files Browse the repository at this point in the history
…ntrol\TimeZoneInformation r=andrebargull
  • Loading branch information
longsonr committed Dec 30, 2016
1 parent 1fe6a73 commit 49931d3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
26 changes: 26 additions & 0 deletions intl/icu-patches/bug-1325858-close-key.diff
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions intl/icu/source/common/wintz.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ static LONG getTZKeyName(char* tzKeyName, int32_t length) {
&cbData);
}

RegCloseKey(hkey);

return result;
}

Expand Down
1 change: 1 addition & 0 deletions intl/update-icu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49931d3

Please sign in to comment.