diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-03-25 20:07:48 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-03-25 20:08:26 +0900 |
commit | dd52330db6551c3e96fce5ba17ff823882d158fd (patch) | |
tree | 101c7be6d8919782cae3943af9f1568e0d10b898 /basic/source/runtime/runtime.cxx | |
parent | 259ec024baf0592fe2d7dfea32ee052f8b5b3d20 (diff) |
Avoid possible resource leaks by boost::scoped_array
Change-Id: I14e1f7ef217eb5e8e9db9f8962af868ab0a4ab81
Diffstat (limited to 'basic/source/runtime/runtime.cxx')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 3ee4b93c2ed7..66026e0deefc 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -66,6 +66,7 @@ #include "sbintern.hxx" #include "sbunoobj.hxx" #include <basic/codecompletecache.hxx> +#include <boost/scoped_array.hpp> using com::sun::star::uno::Reference; @@ -4453,9 +4454,9 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) bool bRangeError = false; // Store dims to use them for copying later - sal_Int32* pLowerBounds = new sal_Int32[nDims]; - sal_Int32* pUpperBounds = new sal_Int32[nDims]; - sal_Int32* pActualIndices = new sal_Int32[nDims]; + boost::scoped_array<sal_Int32> pLowerBounds(new sal_Int32[nDims]); + boost::scoped_array<sal_Int32> pUpperBounds(new sal_Int32[nDims]); + boost::scoped_array<sal_Int32> pActualIndices(new sal_Int32[nDims]); if( nDimsOld != nDimsNew ) { bRangeError = true; @@ -4488,11 +4489,8 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) // (It would be faster to work on the flat internal data array of an // SbyArray but this solution is clearer and easier) implCopyDimArray_DCREATE( pArray, pOldArray, nDims - 1, - 0, pActualIndices, pLowerBounds, pUpperBounds ); + 0, pActualIndices.get(), pLowerBounds.get(), pUpperBounds.get() ); } - delete [] pUpperBounds; - delete [] pLowerBounds; - delete [] pActualIndices; refRedimpArray = NULL; } } |