summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 16:22:16 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 16:26:16 +0200
commit29858ef0f626826464f0452ec42d274742230455 (patch)
treec917637cb4e7478874ae4b3b776cb56db95a5c81 /l10ntools
parent4a59b7519688e4f7662367e3b4bee01d91ade9cd (diff)
CID#1078786: fix memory leak
Change-Id: I17a257f2abe90e8d489fa1af0e0889934dc3fd47
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/pocheck.cxx24
1 files changed, 14 insertions, 10 deletions
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index 9dcbe75e250e..a7c16e4648d5 100644
--- a/l10ntools/source/pocheck.cxx
+++ b/l10ntools/source/pocheck.cxx
@@ -33,15 +33,19 @@ static void checkStyleNames(OString aLanguage)
for(;;)
{
- PoEntry* aPoEntry = new PoEntry();
- aPoInput.readEntry(*aPoEntry);
+ PoEntry* pPoEntry = new PoEntry();
+ aPoInput.readEntry(*pPoEntry);
bool bRepeated = false;
if( aPoInput.eof() )
+ {
+ delete pPoEntry;
break;
- if( !aPoEntry->isFuzzy() && aPoEntry->getSourceFile() == "poolfmt.src" &&
- aPoEntry->getGroupId().startsWith("STR_POOLCOLL") )
+ }
+
+ if( !pPoEntry->isFuzzy() && pPoEntry->getSourceFile() == "poolfmt.src" &&
+ pPoEntry->getGroupId().startsWith("STR_POOLCOLL") )
{
- OString aMsgStr = aPoEntry->getMsgStr();
+ OString aMsgStr = pPoEntry->getMsgStr();
if( aMsgStr.isEmpty() )
continue;
if( aLocalizedStyleNames.find(aMsgStr) == aLocalizedStyleNames.end() )
@@ -51,10 +55,10 @@ static void checkStyleNames(OString aLanguage)
bRepeated = true;
}
}
- if( !aPoEntry->isFuzzy() && aPoEntry->getSourceFile() == "poolfmt.src" &&
- aPoEntry->getGroupId().startsWith("STR_POOLNUMRULE") )
+ if( !pPoEntry->isFuzzy() && pPoEntry->getSourceFile() == "poolfmt.src" &&
+ pPoEntry->getGroupId().startsWith("STR_POOLNUMRULE") )
{
- OString aMsgStr = aPoEntry->getMsgStr();
+ OString aMsgStr = pPoEntry->getMsgStr();
if( aMsgStr.isEmpty() )
continue;
if( aLocalizedNumStyleNames.find(aMsgStr) == aLocalizedNumStyleNames.end() )
@@ -65,9 +69,9 @@ static void checkStyleNames(OString aLanguage)
}
}
if (bRepeated)
- repeatedEntries.push_back(aPoEntry);
+ repeatedEntries.push_back(pPoEntry);
else
- delete aPoEntry;
+ delete pPoEntry;
}
aPoInput.close();