summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods1.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-25 20:07:48 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-25 20:08:26 +0900
commitdd52330db6551c3e96fce5ba17ff823882d158fd (patch)
tree101c7be6d8919782cae3943af9f1568e0d10b898 /basic/source/runtime/methods1.cxx
parent259ec024baf0592fe2d7dfea32ee052f8b5b3d20 (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: I14e1f7ef217eb5e8e9db9f8962af868ab0a4ab81
Diffstat (limited to 'basic/source/runtime/methods1.cxx')
-rw-r--r--basic/source/runtime/methods1.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 6b52e281600e..00c8b7d1a1eb 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/i18n/LocaleCalendar.hpp>
#include <com/sun/star/sheet/XFunctionAccess.hpp>
+#include <boost/scoped_array.hpp>
using namespace comphelper;
using namespace com::sun::star::i18n;
@@ -1277,9 +1278,9 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
{
sal_Size nFPos = pStrm->Tell();
short nDims = pArr->GetDims();
- short* pDims = new short[ nDims ];
- bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims,bPut);
- delete [] pDims;
+ boost::scoped_array<short> pDims(new short[ nDims ]);
+ bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims.get(),bPut);
+ pDims.reset();
if( nBlockLen )
pStrm->Seek( nFPos + nBlockLen );
}