From 4f4a02c2256d1e4a45eaa9b05bcb5f85e7652bc2 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Sun, 3 May 2009 16:49:52 -0400 Subject: [PATCH] dataToBigInteger: Change a `delete' to `delete []'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug reported by Nicolás Carrasco. --- BigIntegerUtils.hh | 2 +- ChangeLog | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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. -- 2.34.1