Browse Source

fix possible memory leak in bitvector

tempestpy_adaptions
dehnert 7 years ago
parent
commit
d6c5367e85
  1. 3
      src/storm/storage/BitVector.cpp

3
src/storm/storage/BitVector.cpp

@ -116,7 +116,10 @@ namespace storm {
// Only perform the assignment if the source and target are not identical. // Only perform the assignment if the source and target are not identical.
if (this != &other) { if (this != &other) {
bitCount = other.bitCount; bitCount = other.bitCount;
if (buckets && bucketCount() != other.bucketCount()) {
delete[] buckets;
buckets = new uint64_t[other.bucketCount()]; buckets = new uint64_t[other.bucketCount()];
}
std::copy_n(other.buckets, other.bucketCount(), buckets); std::copy_n(other.buckets, other.bucketCount(), buckets);
} }
return *this; return *this;

Loading…
Cancel
Save