diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-06-20 13:55:33 -0500 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-24 12:22:50 +0000 |
commit | 37e1d7a0df85530f6a67adfda76d2c06e05b569e (patch) | |
tree | c8b24514d24427e1febc8173174dc068be5e3d45 | |
parent | cf003b228efc9d95d85fafceb7095e85c882277c (diff) |
coverity#705765: Resource leak
Change-Id: Ibf9d4716e5c5929fe47c836812879f815aa78d6c
Reviewed-on: https://gerrit.libreoffice.org/4408
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/ui/shells/textsh.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 62907a448c45..2b5c607ebac3 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -221,10 +221,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) aStrURL = URIHelper::SmartRel2Abs( INetURLObject(), aStrURL, URIHelper::GetMaybeFileHdl() ); - INetURLObject* pURL = new INetURLObject(); - pURL->SetSmartProtocol( INET_PROT_FILE ); + INetURLObject url; + url.SetSmartProtocol( INET_PROT_FILE ); - if ( pURL->SetURL( aStrURL, INetURLObject::WAS_ENCODED ) ) + if ( url.SetURL( aStrURL, INetURLObject::WAS_ENCODED ) ) { OUString aName; comphelper::EmbeddedObjectContainer aCnt; @@ -238,7 +238,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) if ( xSet.is() ) { xSet->setPropertyValue( OUString("PluginURL"), - uno::makeAny( OUString( pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) ); + uno::makeAny( OUString( url.GetMainURL( INetURLObject::NO_DECODE ) ) ) ); } } |