summaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-29 14:26:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-31 07:32:04 +0100
commit167a2a0a89771f94b9f1124667cfd92459d03869 (patch)
tree6ca7b32ff2697dc3d7e2c817acd05c81ee2aa09d /registry
parentcdeb83ed3350c898af02dfe021f5da861517c2f6 (diff)
loplugin:useuniqueptr in TypeWriter::createBlop
Change-Id: Iafc9fdcaeb83d1a383ed60b3b610043d0325cde2 Reviewed-on: https://gerrit.libreoffice.org/62650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'registry')
-rw-r--r--registry/source/reflwrit.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index 3fe279b28483..9c753cf9c444 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -728,7 +728,7 @@ void TypeWriter::createBlop()
CPInfo root(CP_TAG_INVALID, nullptr);
sal_uInt16 cpIndexThisName = 0;
- sal_uInt16* cpIndexSuperNames = nullptr;
+ std::unique_ptr<sal_uInt16[]> cpIndexSuperNames;
sal_uInt16 cpIndexDoku = 0;
sal_uInt16 cpIndexFileName = 0;
CPInfo* pInfo = nullptr;
@@ -755,7 +755,7 @@ void TypeWriter::createBlop()
{
blopSize += m_nSuperTypes * entrySize;
- cpIndexSuperNames = new sal_uInt16[m_nSuperTypes];
+ cpIndexSuperNames.reset(new sal_uInt16[m_nSuperTypes]);
for (sal_uInt32 i=0; i < m_nSuperTypes; i++)
{
@@ -1059,7 +1059,7 @@ void TypeWriter::createBlop()
{
pBuffer += writeUINT16(pBuffer, cpIndexSuperNames[i]);
}
- delete[] cpIndexSuperNames;
+ cpIndexSuperNames.reset();
}
pBuffer += writeUINT16(pBuffer, cpCount);