Bug 504432 - [WinCE] updater.exe not launched when there is an update during startup. r=vlad
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 29 Jul 2009 23:01:50 -0700
changeset 30893 b6db983a933c4d5844110467ae3f762824da9eff
parent 30892 04a7efa84f8706c27196daba1a2bac4451c82820
child 30894 88e95d638b35c7724b1a202c6e2485c1faef918f
push id8289
push userrstrong@mozilla.com
push dateThu, 30 Jul 2009 06:02:07 +0000
treeherdermozilla-central@b6db983a933c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs504432
milestone1.9.2a1pre
Bug 504432 - [WinCE] updater.exe not launched when there is an update during startup. r=vlad
toolkit/xre/nsUpdateDriver.cpp
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -120,22 +120,21 @@ GetCurrentWorkingDir(char *buf, size_t s
 {
   // Cannot use NS_GetSpecialDirectory because XPCOM is not yet initialized.
   // This code is duplicated from xpcom/io/SpecialSystemDirectory.cpp:
 
 #if defined(XP_OS2)
   if (DosQueryPathInfo( ".", FIL_QUERYFULLNAME, buf, size))
     return NS_ERROR_FAILURE;
 #elif defined(XP_WIN)
-  wchar_t *wpath = _wgetcwd(NULL, size);
-  if (!wpath)
+  wchar_t wpath[MAX_PATH];
+  if (!_wgetcwd(wpath, size))
     return NS_ERROR_FAILURE;
   NS_ConvertUTF16toUTF8 path(wpath);
   strncpy(buf, path.get(), size);
-  free(wpath);
 #else
   if(!getcwd(buf, size))
     return NS_ERROR_FAILURE;
 #endif
   return NS_OK;
 }
 
 #if defined(XP_MACOSX)