fixed invalid memory read

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2004-02-26 21:49:54 +00:00
parent a4b4366304
commit c76b647492

View File

@ -1418,9 +1418,11 @@ bool wxLocale::Init(const wxChar *szName,
// TODO: how to find languageId
// SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
#else
m_pszOldLocale = wxSetlocale(LC_ALL, szLocale);
if ( m_pszOldLocale )
m_pszOldLocale = wxStrdup(m_pszOldLocale);
wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, szLocale);
if ( oldLocale )
m_pszOldLocale = wxStrdup(oldLocale);
else
m_pszOldLocale = NULL;
#endif
if ( m_pszOldLocale == NULL )