summaryrefslogtreecommitdiff
path: root/io/source/stm/streamhelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'io/source/stm/streamhelper.cxx')
-rw-r--r--io/source/stm/streamhelper.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx
index 0ef0d3e1f7ae..c382cae96390 100644
--- a/io/source/stm/streamhelper.cxx
+++ b/io/source/stm/streamhelper.cxx
@@ -75,8 +75,10 @@ void MemRingBuffer::resizeBuffer( sal_Int32 nMinSize )
}
if( nNewLen != m_nBufferLen ) {
- m_p = static_cast<sal_Int8 *>(std::realloc( m_p , nNewLen ));
- if( !m_p ) {
+ if (auto p = static_cast<sal_Int8*>(std::realloc(m_p, nNewLen)))
+ m_p = p;
+ else
+ {
throw css::io::BufferSizeExceededException(
"MemRingBuffer::resizeBuffer BufferSizeExceededException");
}