summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/source/stream/stream.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 5d6d3e58336b..b48275819739 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1866,7 +1866,12 @@ bool SvMemoryStream::ReAllocateMemory( long nDiff )
void SvMemoryStream::FreeMemory()
{
- delete[] pBuf;
+ assert(bOwnsData);
+ if (bOwnsData)
+ {
+ delete[] pBuf;
+ pBuf = nullptr;
+ }
}
void* SvMemoryStream::SwitchBuffer()