From: Matt McCutchen Date: Sun, 3 May 2009 20:49:52 +0000 (-0400) Subject: dataToBigInteger: Change a `delete' to `delete []'. X-Git-Tag: v2009.05.03~2 X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/commitdiff_plain/4f4a02c2256d1e4a45eaa9b05bcb5f85e7652bc2 dataToBigInteger: Change a `delete' to `delete []'. Bug reported by Nicolás Carrasco. --- diff --git a/BigIntegerUtils.hh b/BigIntegerUtils.hh index 2f6d22f..c815b5d 100644 --- a/BigIntegerUtils.hh +++ b/BigIntegerUtils.hh @@ -65,7 +65,7 @@ BigInteger dataToBigInteger(const T* data, BigInteger::Index length, BigInteger: // Create the BigInteger. BigInteger x(blocks, numBlocks, sign); - delete blocks; + delete [] blocks; return x; } diff --git a/ChangeLog b/ChangeLog index 11d1ee9..0f87898 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ roughly corresponds to the release date of that version in `YYYY.MM.DD[.N]' format, where `.N' goes `.2', `.3', etc. if there are multiple versions on the same day. The topmost version listed is the one you have. +Unreleased +---------- +- dataToBigInteger: Change a `delete' to `delete []' to avoid leaking memory. + Bug reported by Nicolás Carrasco. + 2009.03.26 ---------- - BigUnsignedInABase(std::string) Reject digits too big for the base.