summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-12 12:00:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-12 15:14:01 +0200
commit59935c314945cdc365878a898317bfaa366fc36e (patch)
tree3aef15d5b4f2ac3b70a8bf87441cbab7f37d8b18 /sfx2
parent6b03d6f3b29964c6311b97af5734529285a37f3f (diff)
fix leak in SfxApplication::OpenDocExec_Impl
when calling Link on SfxLinkItem, none of the callee sites free the memory associated with the Clone()'ed SfxPoolItem, so just skip the cloning, and make the Link take a const pointer to make this more obvious. Change-Id: Icd187e9d8d3ace9bf2e6ff183489999b105708e4 Reviewed-on: https://gerrit.libreoffice.org/55671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 47ba55e34947..60f2c508ebbb 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1122,8 +1122,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
const SfxPoolItem* pRetValue = rReq.GetReturnValue();
if (pRetValue)
{
- SfxPoolItem* pClone = pRetValue->Clone();
- pLinkItem->GetValue().Call(pClone);
+ pLinkItem->GetValue().Call(pRetValue);
}
delete pLinkItem;
}