From: Tim Kosse Date: Mon, 23 Jan 2017 17:46:42 +0000 (+0100) Subject: Fix memory leak in ed25519_openssh_createkey X-Git-Tag: 0.68~75 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e882b49051ad731686a97f7317289ef4229ec76a;p=PuTTY.git Fix memory leak in ed25519_openssh_createkey If q could not be read from the input blob, the allocated ec_key structure was not freed. --- diff --git a/sshecc.c b/sshecc.c index 3bb2082b..3ce6c7fe 100644 --- a/sshecc.c +++ b/sshecc.c @@ -2029,10 +2029,10 @@ static void *ed25519_openssh_createkey(const struct ssh_signkey *self, } getstring((const char**)blob, len, &q, &qlen); - if (!q) - return NULL; - if (qlen != 64) + if (!q || qlen != 64) { + ecdsa_freekey(ec); return NULL; + } ec->privateKey = bignum_from_bytes_le((const unsigned char *)q, 32);