diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-27 11:08:49 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-27 11:38:08 +0900 |
commit | eeb0ff07ad90936cff16f065680b95f0e4ae7192 (patch) | |
tree | 722455778f890860b9cf0ef67792e74a02678cdc /sw | |
parent | 39026305e25d3b010e95a0dfa3ae9ca4f1319e98 (diff) |
Fix memory leaks
Change-Id: Ied2b622d4a1dd20a1b79c270aa7b4828e5c103f2
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 24b2ae21b13f..c269ceec588d 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -44,6 +44,8 @@ #include <set> #include <cctype> +#include <boost/scoped_array.hpp> + using namespace ::com::sun::star; using ::std::vector; @@ -1577,11 +1579,11 @@ void SwCompareData::CheckForChangesInLine( const CompareData& rData, rStt, rEnd ); int nMinLen = std::min( aCmp.GetLen1(), aCmp.GetLen2() ); - int *pLcsDst = new int[ nMinLen ]; - int *pLcsSrc = new int[ nMinLen ]; + boost::scoped_array<int> pLcsDst(new int[ nMinLen ]); + boost::scoped_array<int> pLcsSrc(new int[ nMinLen ]); FastCommonSubseq subseq( aCmp ); - int nLcsLen = subseq.Find( pLcsDst, pLcsSrc ); + int nLcsLen = subseq.Find( pLcsDst.get(), pLcsSrc.get() ); for (int i = 0; i <= nLcsLen; i++) { // Beginning of inserted lines (inclusive) |