[Libreoffice-commits] core.git: vcl/source

Takeshi Abe tabe at fixedpoint.jp
Wed Jul 5 09:09:43 UTC 2017


 vcl/source/filter/graphicfilter.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d366250c7fc07c35be04f71c311555ab7e156d5f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Jul 5 16:13:28 2017 +0900

    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 at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

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 )


More information about the Libreoffice-commits mailing list