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);