]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix memory leak in bignum_from_decimal
authorTim Kosse <tim.kosse@filezilla-project.org>
Mon, 23 Jan 2017 17:55:20 +0000 (18:55 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 28 Jan 2017 14:03:09 +0000 (14:03 +0000)
Intermediate result values were not freed.

sshbn.c

diff --git a/sshbn.c b/sshbn.c
index 724cf3011583682adf754fe609b59d7a998e5e91..6768204bc4cd2ec930799bcc3d250407928d63a2 100644 (file)
--- a/sshbn.c
+++ b/sshbn.c
@@ -1461,6 +1461,7 @@ Bignum bignum_from_decimal(const char *decimal)
 
         tmp = bigmul(result, Ten);
         tmp2 = bignum_from_long(*decimal - '0');
+        freebn(result);
         result = bigadd(tmp, tmp2);
         freebn(tmp);
         freebn(tmp2);