summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-08 10:29:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-08 12:59:36 +0200
commit70094be161b64d1c5f837054508a6b8ad59ed337 (patch)
treeb6e2c4cd7192adc128ac21a2ea73cb041d1c7c59
parent42f2c438976ef95c23868af3a997dd971aece7a5 (diff)
cid#1466647 Resource leak
and cid#1466652 Resource leak cid#1466655 Resource leak cid#1466662 Resource leak Change-Id: I0f1bc254519dd79442493890dfdff3c1f9ce87d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102229 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/svx/galleryobjectcollection.hxx1
-rw-r--r--svx/source/gallery2/galleryobjectcollection.cxx3
2 files changed, 2 insertions, 2 deletions
diff --git a/include/svx/galleryobjectcollection.hxx b/include/svx/galleryobjectcollection.hxx
index 8e322549b5eb..a1373a44897a 100644
--- a/include/svx/galleryobjectcollection.hxx
+++ b/include/svx/galleryobjectcollection.hxx
@@ -49,6 +49,7 @@ class SVXCORE_DLLPUBLIC GalleryObjectCollection
{
private:
std::vector<std::unique_ptr<GalleryObject>> m_aObjectList;
+ INetURLObject m_aInvalidURL;
public:
GalleryObjectCollection();
diff --git a/svx/source/gallery2/galleryobjectcollection.cxx b/svx/source/gallery2/galleryobjectcollection.cxx
index c5667eea2dca..4082852ce371 100644
--- a/svx/source/gallery2/galleryobjectcollection.cxx
+++ b/svx/source/gallery2/galleryobjectcollection.cxx
@@ -53,8 +53,7 @@ const INetURLObject& GalleryObjectCollection::getURLForPosition(sal_uInt32 nPos)
{
if (nPos < size())
return get(nPos)->getURL();
- INetURLObject* aInvalidURL = new INetURLObject();
- return *aInvalidURL;
+ return m_aInvalidURL;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */