summaryrefslogtreecommitdiff
path: root/sw/source/ui/envelp/envfmt.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-06-04 04:11:15 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-06-04 04:17:18 +0900
commit7883992dd5f8561b6eb192fce864b76c3034b1c5 (patch)
tree7025fcae30913753f8ec86e502bec5d33bb436f3 /sw/source/ui/envelp/envfmt.cxx
parentb1a5aedb74d623709c4448b75c250e9fe17b9c28 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: I45929aae52fa106b5f5c0199f8ce8b60c0ac5438
Diffstat (limited to 'sw/source/ui/envelp/envfmt.cxx')
-rw-r--r--sw/source/ui/envelp/envfmt.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 760c9c278d59..c816fe933972 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -44,6 +44,7 @@
#include <vector>
#include <algorithm>
+#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include "swabstdlg.hxx"
@@ -352,12 +353,11 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, bool bSender)
std::vector<sal_uInt16> pVec = ::lcl_convertRangesToList(pRanges);
std::vector<sal_uInt16> aVec = ::lcl_convertRangesToList(aRanges);
pVec.insert(pVec.end(), aVec.begin(), aVec.end());
- sal_uInt16 *pNewRanges = ::lcl_convertListToRanges(pVec);
+ boost::scoped_array<sal_uInt16> pNewRanges(::lcl_convertListToRanges(pVec));
pAddrSet = new SfxItemSet(GetParentSwEnvDlg()->pSh->GetView().GetCurShell()->GetPool(),
- pNewRanges);
+ pNewRanges.get());
pAddrSet->Put(pColl->GetAttrSet());
- delete[] pNewRanges;
}
return pAddrSet;