diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-07-05 16:13:28 +0900 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 11:09:12 +0200 |
commit | d366250c7fc07c35be04f71c311555ab7e156d5f (patch) | |
tree | d0b92bb1b75b2d0704123ee008364223073c629f /vcl | |
parent | 4b2262ab5b10f334f1984fec84d2978db81c58f1 (diff) |
vcl: Fix memory leak at importing graphic from a URL
Change-Id: I9e511f69f489e35ff5805af8fadcdd0d69cdb8d6
Reviewed-on: https://gerrit.libreoffice.org/39553
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 6ae9459f5bd6..8f4b1474e850 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2360,11 +2360,9 @@ ErrCode GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilt aURL.SetSmartURL( rPath ); } - SvStream* pStream = nullptr; + std::unique_ptr<SvStream> pStream; if ( INetProtocol::File != aURL.GetProtocol() ) - { - pStream = ::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ ); - } + pStream.reset(::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ )); ErrCode nRes = ERRCODE_NONE; if ( !pStream ) |