1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

ecdsa_new_priv_openssh: use correct free function on failure.

Thanks to Ralf Esswein for pointing out the slip, which should have
been corrected as part of 867e69187.

It didn't cause a test failure, because the ecdsa and eddsa structs
are currently so similar in layout (they differ only in the pointed-to
public key point structure, and on this failure path that pointer is
NULL anyway). As a result it's rather hard to add a regression test
against it failing again; I think I just have to chalk this one up to
the lack of OO-aware type checking when doing this kind of manual
vtable management in C, unfortunately.
This commit is contained in:
Simon Tatham 2019-06-23 13:50:48 +01:00
parent 9dcf781d01
commit 02dfae7fe4

View File

@ -804,7 +804,7 @@ static ssh_key *ecdsa_new_priv_openssh(
ek->publicKey = get_wpoint(src, curve);
if (!ek->publicKey) {
eddsa_freekey(&ek->sshk);
ecdsa_freekey(&ek->sshk);
return NULL;
}