diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-11 21:25:38 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-10-17 02:49:37 +0200 |
commit | 14940227849e792ce161633a87adf687b2bf9140 (patch) | |
tree | 141de2e5a415589dc25fafb152ae98d396d79827 /svx | |
parent | 98404a843198c532c5639b073a3a83ff3529615b (diff) |
CID#1028073: possible memory leak
Change-Id: Ifbc7d7b04b20fbf46204866a82aa10319c5dddf2
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index c82dc4927780..54af4a1c1b10 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -562,10 +562,10 @@ GraphyicBulletsTypeMgr::GraphyicBulletsTypeMgr() GraphyicBulletsTypeMgr::GraphyicBulletsTypeMgr(const GraphyicBulletsTypeMgr& aTypeMgr): NBOTypeMgrBase(aTypeMgr) { - for (sal_uInt16 i=0;i< aTypeMgr.aGrfDataLst.size();++i) + for (size_t i=0, n = aTypeMgr.aGrfDataLst.size(); i < n; ++i) { GrfBulDataRelation* pEntry = new GrfBulDataRelation(eNBType::GRAPHICBULLETS); - GrfBulDataRelation* pSrcEntry = i < aTypeMgr.aGrfDataLst.size() ? aTypeMgr.aGrfDataLst[i] : NULL; + GrfBulDataRelation* pSrcEntry = aTypeMgr.aGrfDataLst[i]; if ( pEntry && pSrcEntry) { pEntry->bIsCustomized = pSrcEntry->bIsCustomized; @@ -575,6 +575,8 @@ GraphyicBulletsTypeMgr::GraphyicBulletsTypeMgr(const GraphyicBulletsTypeMgr& aTy pEntry->sDescription = pSrcEntry->sDescription; aGrfDataLst.push_back(pEntry); } + else + delete pEntry; } } |