From 7764ae70b04058a64a3999529e98d1115ba59d1c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Sep 2018 15:47:40 +0200 Subject: clang bugprone-unused-return-value most of these changes just make the change of ownership when using std::unique_ptr clearer, but there is one definite leak fix in PlainTextFilterDetect::detect Change-Id: I8282a68007222a4fee84004f394bde0cca8569e9 Reviewed-on: https://gerrit.libreoffice.org/60159 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- package/source/zippackage/ZipPackageStream.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'package') diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 5fe4d0ef80c5..5e62b8bf1aff 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -727,10 +727,9 @@ bool ZipPackageStream::saveChild( if ( m_bRawStream ) xStream->skipBytes( m_nMagicalHackPos ); - ZipOutputStream::setEntry(pTempEntry); - rZipOut.writeLOC(pTempEntry); // the entry is provided to the ZipOutputStream that will delete it - pAutoTempEntry.release(); + ZipOutputStream::setEntry(pAutoTempEntry.release()); + rZipOut.writeLOC(pTempEntry); uno::Sequence < sal_Int8 > aSeq ( n_ConstBufferSize ); sal_Int32 nLength; @@ -797,9 +796,8 @@ bool ZipPackageStream::saveChild( try { - ZipOutputStream::setEntry(pTempEntry); // the entry is provided to the ZipOutputStream that will delete it - pAutoTempEntry.release(); + ZipOutputStream::setEntry(pAutoTempEntry.release()); if (pTempEntry->nMethod == STORED) { -- cgit