From c76b647492dce0f5624219a3f42edb6bbcee0069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 26 Feb 2004 21:49:54 +0000 Subject: [PATCH] fixed invalid memory read git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/intl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index e3f2208e59..03bd63e27b 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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 )