[Libreoffice-commits] core.git: sfx2/source
Takeshi Abe
tabe at fixedpoint.jp
Thu Jul 20 13:30:41 UTC 2017
sfx2/source/doc/docfile.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 0d5b54116b92c126eb7fcd7b832aceed17011c79
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Mon Jul 3 21:16:20 2017 +0900
sfx2: Fix a memory leak in SfxMedium::GetStorage()
Change-Id: I7e5590abc7fbac33140029a8b7222a8bd08278f4
Reviewed-on: https://gerrit.libreoffice.org/39473
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
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
More information about the Libreoffice-commits
mailing list