]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Two small memory leaks, also noticed by Martin Prikryl.
authorSimon Tatham <anakin@pobox.com>
Wed, 21 Jan 2004 19:41:34 +0000 (19:41 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 21 Jan 2004 19:41:34 +0000 (19:41 +0000)
[originally from svn r3752]

ssh.c
sshbn.c

diff --git a/ssh.c b/ssh.c
index 6c1aeb7529793dc00704682d7a4f465ab1371e2c..89fa7854923e06603e197d73c23e8bbde09cda9d 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -5198,6 +5198,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt)
 
                    ssh2_pkt_send(ssh);
                    s->type = AUTH_TYPE_PUBLICKEY;
+                   key->alg->freekey(key->data);
                }
            } else if (s->method == AUTH_PASSWORD) {
                /*
diff --git a/sshbn.c b/sshbn.c
index d0608a3ac3213a4db23f6bb8d7c463ee212f638d..8d4d703c3849af3cf4c6671c05b3281945b74699 100644 (file)
--- a/sshbn.c
+++ b/sshbn.c
@@ -909,6 +909,7 @@ Bignum modinv(Bignum number, Bignum modulus)
        x = bigmuladd(q, xp, t);
        sign = -sign;
        freebn(t);
+       freebn(q);
     }
 
     freebn(b);