Bug 504432 - [WinCE] updater.exe not launched when there is an update during startup. r=vlad
--- 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)