diff options
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/ruby/common/DataBlock.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh index 1d399753e..d62efc72b 100644 --- a/src/mem/ruby/common/DataBlock.hh +++ b/src/mem/ruby/common/DataBlock.hh @@ -82,7 +82,9 @@ bool operator==(const DataBlock& obj1, const DataBlock& obj2); inline void DataBlock::assign(uint8* data) { - delete [] m_data; + if (m_alloc) { + delete [] m_data; + } m_data = data; m_alloc = false; } |