diff --git a/src/storm/storage/BitVector.cpp b/src/storm/storage/BitVector.cpp index 60fdf166b..924657b44 100644 --- a/src/storm/storage/BitVector.cpp +++ b/src/storm/storage/BitVector.cpp @@ -116,7 +116,10 @@ namespace storm { // Only perform the assignment if the source and target are not identical. if (this != &other) { bitCount = other.bitCount; - buckets = new uint64_t[other.bucketCount()]; + if (buckets && bucketCount() != other.bucketCount()) { + delete[] buckets; + buckets = new uint64_t[other.bucketCount()]; + } std::copy_n(other.buckets, other.bucketCount(), buckets); } return *this;