summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 09:42:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 15:18:26 +0200
commitbb209f2f53edc1b0d268d561e0c12bf93e83fb41 (patch)
tree09ede9f9b8c8ff39c8b958fcf000580681ca59b1 /package
parenta1949a419e2e4bec52906bb163b0cf510fe2aa14 (diff)
Revert "clang bugprone-unused-return-value"
comment from sberg: aren't these changes broken in general, when the called function may throw an exception before it takes ownership of the passed-in pointer? So revert, except for (a) PlainTextFilterDetect::detect, which was definitely a leak (b) SwCursor::FindAll, where unique_ptr was being unnecessarily used This reverts commit 7764ae70b04058a64a3999529e98d1115ba59d1c. Change-Id: I555e651b44e245b031729013d2ce88d26e8a357e Reviewed-on: https://gerrit.libreoffice.org/60301 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 5e62b8bf1aff..5fe4d0ef80c5 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -727,9 +727,10 @@ bool ZipPackageStream::saveChild(
if ( m_bRawStream )
xStream->skipBytes( m_nMagicalHackPos );
- // the entry is provided to the ZipOutputStream that will delete it
- ZipOutputStream::setEntry(pAutoTempEntry.release());
+ ZipOutputStream::setEntry(pTempEntry);
rZipOut.writeLOC(pTempEntry);
+ // the entry is provided to the ZipOutputStream that will delete it
+ pAutoTempEntry.release();
uno::Sequence < sal_Int8 > aSeq ( n_ConstBufferSize );
sal_Int32 nLength;
@@ -796,8 +797,9 @@ bool ZipPackageStream::saveChild(
try
{
+ ZipOutputStream::setEntry(pTempEntry);
// the entry is provided to the ZipOutputStream that will delete it
- ZipOutputStream::setEntry(pAutoTempEntry.release());
+ pAutoTempEntry.release();
if (pTempEntry->nMethod == STORED)
{