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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 23 14:32:02 UTC 2018


 sfx2/source/doc/docfile.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 036d8cb359c3d08793ed371c554a3ce3196f725d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 23 11:56:08 2018 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jul 23 16:31:41 2018 +0200

    crashtesting: ooo72057-1.doc
    
    fallout from
        commit 65e41592a650887c
        pass SvStream around by std::unique_ptr
    
    The backtrace where it was was freeing the SvStream we need is below,
    the code seems dodgy because it is re-creating the underlying SvStream. Before
    65e41592a650887c, it just leaked the SvStream.
    
    0  SvStream::~SvStream()
        at tools/source/stream/stream.cxx:369
    1  SvFileStream::~SvFileStream()
        at tools/source/stream/strmunx.cxx:300
    2  SvFileStream::~SvFileStream()
        at tools/source/stream/strmunx.cxx:298
    3  std::default_delete<SvStream>::operator()(SvStream*) const
    4  std::unique_ptr<SvStream, std::default_delete<SvStream> >::reset(SvStream*)
    5  std::unique_ptr<SvStream, std::default_delete<SvStream> >::operator=(std::unique_ptr<SvStream, std::default_delete<SvStream> >&&)
    6  SfxMedium::GetMedium_Impl()
         at sfx2/source/doc/docfile.cxx:2603
    7  SfxMedium::GetInputStream()
        at sfx2/source/doc/docfile.cxx:3329
    8  ImportExcel8::ReadBasic()
        at sc/source/filter/excel/excimp8.cxx:391
    9  ImportExcel8::PostDocLoad()
        at sc/source/filter/excel/excimp8.cxx:425
    10 ImportExcel8::Read() (this=0x4727a10)
        at sc/source/filter/excel/read.cxx:1298
    11 ScFormatFilterPluginImpl::ScImportExcel(SfxMedium&, ScDocument*, EXCIMPFORMAT)
        at sc/source/filter/excel/excel.cxx:142
    
    Change-Id: I4fb769a7da71ef9a27ddef1581448efb3d303bde
    Reviewed-on: https://gerrit.libreoffice.org/57843
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 56a976572e25..ced74fa616e2 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2597,7 +2597,7 @@ void SfxMedium::GetMedium_Impl()
         if ( !GetError() && !pImpl->xStream.is() && !pImpl->xInputStream.is() )
             SetError(ERRCODE_IO_ACCESSDENIED);
 
-        if ( !GetError() )
+        if ( !GetError() && !pImpl->m_pInStream )
         {
             if ( pImpl->xStream.is() )
                 pImpl->m_pInStream = utl::UcbStreamHelper::CreateStream( pImpl->xStream );


More information about the Libreoffice-commits mailing list