dataToBigInteger: Change a `delete' to `delete []'.
authorMatt McCutchen <matt@mattmccutchen.net>
Sun, 3 May 2009 20:49:52 +0000 (16:49 -0400)
committerMatt McCutchen <matt@mattmccutchen.net>
Sun, 3 May 2009 20:49:52 +0000 (16:49 -0400)
Bug reported by Nicolás Carrasco.

BigIntegerUtils.hh
ChangeLog

index 2f6d22f..c815b5d 100644 (file)
@@ -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;
 }
 
index 11d1ee9..0f87898 100644 (file)
--- 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.