summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/doccomp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-06 09:46:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-06 09:22:46 +0000
commitaa09b0c27a6d925da428d6267daadc7338829869 (patch)
treeb0fa576ff64820061d9fb876bebacd23e58ddc56 /sw/source/core/doc/doccomp.cxx
parent0c82dff153d92150729815b919854a9a350aa031 (diff)
loplugin:useuniqueptr extend to catch more localvar cases
i.e. where the code looks like { foo * p = new foo; ... delete p; return ...; } Change-Id: Id5f2e55d0363fc62c72535a23faeaaf1f0ac6aee Reviewed-on: https://gerrit.libreoffice.org/36190 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc/doccomp.cxx')
-rw-r--r--sw/source/core/doc/doccomp.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 707d5c1a05bf..78d3fafd74a6 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -2337,7 +2337,7 @@ int CommonSubseq::FindLCS( int *pLcs1, int *pLcs2, int nStt1, int nEnd1,
OSL_ASSERT( nLen1 >= 0 );
OSL_ASSERT( nLen2 >= 0 );
- int **pLcs = new int*[ nLen1 + 1 ];
+ std::unique_ptr<int*[]> pLcs( new int*[ nLen1 + 1 ] );
pLcs[ 0 ] = pData.get();
for( int i = 1; i < nLen1 + 1; i++ )
@@ -2387,8 +2387,6 @@ int CommonSubseq::FindLCS( int *pLcs1, int *pLcs2, int nStt1, int nEnd1,
}
}
- delete[] pLcs;
-
return nLcsLen;
}