summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-08 20:48:14 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-08 21:01:06 +0200
commit228659f0a60839e7a9de320509c60fa97d44cab6 (patch)
treea819710110533d67225019aeafbd0b64c6951640 /unotools
parent9210f1a50a374b824f02fb43a57cdbbbb714d26c (diff)
coverity#1019431: use of freed memory
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 493485444dc9..82b55c1a3ffc 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -20,6 +20,7 @@
#include <string.h> // memcpy()
#include <stdio.h> // fprintf(), stderr
+#include <string>
#include <unotools/localedatawrapper.hxx>
#include <unotools/numberformatcodewrapper.hxx>
@@ -1168,7 +1169,7 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, bool bL
static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber, bool bLeading )
{
- DBG_ASSERT( nNumber < 1000000000, "ImplAdd2UNum() - Number >= 1000000000" );
+ DBG_ASSERT( nNumber < 1000000000, "ImplAdd9UNum() - Number >= 1000000000" );
std::ostringstream ostr;
if (bLeading)
@@ -1177,7 +1178,8 @@ static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber, bool bL
ostr.width(9);
}
ostr << nNumber;
- for(const char *pAB=ostr.str().c_str(); *pAB != '\0'; ++pAB, ++pBuf)
+ std::string aStr = ostr.str();
+ for(const char *pAB= aStr.c_str(); *pAB != '\0'; ++pAB, ++pBuf)
{
*pBuf = *pAB;
}