From dd52330db6551c3e96fce5ba17ff823882d158fd Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Tue, 25 Mar 2014 20:07:48 +0900 Subject: Avoid possible resource leaks by boost::scoped_array Change-Id: I14e1f7ef217eb5e8e9db9f8962af868ab0a4ab81 --- basic/source/runtime/methods1.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'basic/source/runtime/methods1.cxx') 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 #include #include +#include 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 pDims(new short[ nDims ]); + bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims.get(),bPut); + pDims.reset(); if( nBlockLen ) pStrm->Seek( nFPos + nBlockLen ); } -- cgit