diff -u -r boost/mp_math~/mp_int/ctors.hpp boost/mp_math/mp_int/ctors.hpp --- boost/mp_math~/mp_int/ctors.hpp 2008-10-06 04:01:09.000000000 -0700 +++ boost/mp_math/mp_int/ctors.hpp 2009-01-09 16:31:29.000000000 -0800 @@ -260,6 +260,7 @@ template mp_int::~mp_int() { - this->deallocate(digits_, capacity_); + if (digits_) + this->deallocate(digits_, capacity_); } diff -u -r boost/mp_math~/mp_int/mp_int.hpp boost/mp_math/mp_int/mp_int.hpp --- boost/mp_math~/mp_int/mp_int.hpp 2008-10-05 15:37:33.000000000 -0700 +++ boost/mp_math/mp_int/mp_int.hpp 2009-01-09 16:36:28.000000000 -0800 @@ -464,7 +464,8 @@ { if (this != &rhs) { - this->deallocate(digits_, capacity_); + if (digits_) + this->deallocate(digits_, capacity_); digits_ = 0; used_ = 0; capacity_ = 0; @@ -643,7 +644,8 @@ n = new_cap; digit_type* d = this->allocate(n, digits_); std::memcpy(d, digits_, sizeof(digit_type) * used_); - this->deallocate(digits_, capacity_); + if (digits_) + this->deallocate(digits_, capacity_); digits_ = d; capacity_ = n; }