Bug 1325858 - Redundant handles open for HKLM\SYSTEM\ControlSet001\Control\TimeZoneInformation r=andrebargull
authorRobert Longson <longsonr@gmail.com>
Fri, 30 Dec 2016 16:36:05 +0000
changeset 372665 8494bff5a73129bc451e1531cf1734e8e7ba74a1
parent 372664 82fe5697e8faa2d0702b8694ea4b8e588a9368c7
child 372666 1832a6e47f1cf42ecdd33bb65c9c953e6ee11f71
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandrebargull
bugs1325858
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1325858 - Redundant handles open for HKLM\SYSTEM\ControlSet001\Control\TimeZoneInformation r=andrebargull
intl/icu-patches/bug-1325858-close-key.diff
intl/icu/source/common/wintz.c
intl/update-icu.sh
new file mode 100644
--- /dev/null
+++ b/intl/icu-patches/bug-1325858-close-key.diff
@@ -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
--- 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
--- a/intl/update-icu.sh
+++ b/intl/update-icu.sh
@@ -56,16 +56,17 @@ rm ${icu_dir}/source/data/unit/*.txt
 svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO
 
 for patch in \
  bug-915735 \
  suppress-warnings.diff \
  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
   echo "Applying local patch $patch"
   patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch
 done
 
 topsrcdir=`dirname $0`/../