From ae1b0875b2d65513ff013054d6e04aa7f715eaa4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 27 Jun 2020 16:18:35 +0100 Subject: cid#1464973 & cid#1464975 Resource leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4df8fefa7f875e0a25585c4fef22f077dcd0b83d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97318 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/ww8par.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 58d423d3b9a5..bd71f59d7357 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3722,7 +3722,7 @@ ErrCode SwWW8Writer::WriteStorage() { // To avoid long paths split and open substorages recursively // Splitting paths manually, since comphelper::string::split is trimming special characters like \0x01, \0x09 - SotStorage * pStorage = m_pStg.get(); + tools::SvRef pStorage = m_pStg.get(); OUString sFileName; sal_Int32 idx = 0; while (pStorage && idx >= 0) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 546689fc065a..adbd5f6c9e26 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6343,8 +6343,8 @@ static void lcl_getListOfStreams(SotStorage * pStorage, comphelper::SequenceAsHa OUString sStreamFullName = sPrefix.getLength() ? sPrefix + "/" + aElement.GetName() : aElement.GetName(); if (aElement.IsStorage()) { - SotStorage * pSubStorage = pStorage->OpenSotStorage(aElement.GetName(), StreamMode::STD_READ | StreamMode::SHARE_DENYALL); - lcl_getListOfStreams(pSubStorage, aStreamsData, sStreamFullName); + tools::SvRef xSubStorage = pStorage->OpenSotStorage(aElement.GetName(), StreamMode::STD_READ | StreamMode::SHARE_DENYALL); + lcl_getListOfStreams(xSubStorage.get(), aStreamsData, sStreamFullName); } else { -- cgit