diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-07-03 21:16:20 +0900 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-20 15:30:03 +0200 |
commit | 0d5b54116b92c126eb7fcd7b832aceed17011c79 (patch) | |
tree | a5d717dc2be4b0b330c577efe431a40d451542cc /sfx2 | |
parent | 4f75a9310156de50e0c9ffd8d5bed9ee34651e50 (diff) |
sfx2: Fix a memory leak in SfxMedium::GetStorage()
Change-Id: I7e5590abc7fbac33140029a8b7222a8bd08278f4
Reviewed-on: https://gerrit.libreoffice.org/39473
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 20ab8416b02c..a99b4762f458 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1431,7 +1431,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo ) // There the version is stored as packed Stream uno::Reference < io::XStream > xStr = xSub->openStreamElement( rTag.Identifier, embed::ElementModes::READ ); - SvStream* pStream = utl::UcbStreamHelper::CreateStream( xStr ); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( xStr )); if ( pStream && pStream->GetError() == ERRCODE_NONE ) { // Unpack Stream in TempDir @@ -1440,6 +1440,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo ) SvFileStream aTmpStream( aTmpName, SFX_STREAM_READWRITE ); pStream->ReadStream( aTmpStream ); + pStream.reset(); aTmpStream.Close(); // Open data as Storage |