fix #788 pkcs15-tool --read-ssh-key crash

Don't try to free again pubkey if the parent cert has already been freed.

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
This commit is contained in:
Nuno Goncalves 2016-06-06 18:29:03 +01:00
parent 9066d8f999
commit d97ee79333
1 changed files with 2 additions and 2 deletions

View File

@ -1051,8 +1051,8 @@ static int read_ssh_key(void)
fclose(outf);
if (cert)
sc_pkcs15_free_certificate(cert);
sc_pkcs15_free_pubkey(pubkey);
else if (pubkey)
sc_pkcs15_free_pubkey(pubkey);
return 0;
fail:
printf("can't convert key: buffer too small\n");