diff options
Diffstat (limited to 'tools/source/inet/inetmime.cxx')
-rw-r--r-- | tools/source/inet/inetmime.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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: */ |