diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 3 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 6a1a5a22387c..69e698b6d07a 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -600,7 +600,7 @@ Polygon::Polygon( const Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVer const Point aTR( aRect.Right() - nHorzRound, aRect.Top() + nVertRound ); const Point aBR( aRect.Right() - nHorzRound, aRect.Bottom() - nVertRound ); const Point aBL( aRect.Left() + nHorzRound, aRect.Bottom() - nVertRound ); - tools::Polygon* pEllipsePoly = new tools::Polygon( Point(), nHorzRound, nVertRound ); + std::unique_ptr<tools::Polygon> pEllipsePoly( new tools::Polygon( Point(), nHorzRound, nVertRound ) ); sal_uInt16 i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2; mpImplPolygon = new ImplPolygon( pEllipsePoly->GetSize() + 1 ); @@ -621,7 +621,6 @@ Polygon::Polygon( const Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVer ( pDstAry[ i ] = pSrcAry[ i ] ) += aBR; pDstAry[ nEnd ] = pDstAry[ 0 ]; - delete pEllipsePoly; } } } diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 34fb6aa5df46..873f9e9f2b0f 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -2742,16 +2742,15 @@ void INetMIMEOutputSink::writeSequence(const sal_Unicode * pBegin, assert(pBegin && pBegin <= pEnd && "INetMIMEOutputSink::writeSequence(): Bad sequence"); - sal_Char * pBufferBegin = new sal_Char[pEnd - pBegin]; - sal_Char * pBufferEnd = pBufferBegin; + std::unique_ptr<sal_Char[]> pBufferBegin( new sal_Char[pEnd - pBegin] ); + sal_Char * pBufferEnd = pBufferBegin.get(); while (pBegin != pEnd) { DBG_ASSERT(*pBegin < 256, "INetMIMEOutputSink::writeSequence(): Bad octet"); *pBufferEnd++ = sal_Char(*pBegin++); } - writeSequence(pBufferBegin, pBufferEnd); - delete[] pBufferBegin; + writeSequence(pBufferBegin.get(), pBufferEnd); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |