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 945c0306e73b..b0f068370d27 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -599,7 +599,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 ); @@ -620,7 +620,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 05ae7cb91c15..0eb29f55d072 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -2725,16 +2725,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: */ |