diff --git a/src/tools/pkcs15-tool.c b/src/tools/pkcs15-tool.c index 0811c78b..2c0a0814 100644 --- a/src/tools/pkcs15-tool.c +++ b/src/tools/pkcs15-tool.c @@ -828,8 +828,10 @@ static void print_ssh_key(FILE *outf, const char * alg, struct sc_pkcs15_object // Old style openssh - [ [ anything else] // r = sc_base64_encode(buf, len, uu, 2*len, 0); - if (r < 0) + if (r < 0) { + free(uu); return; + } if (obj->label[0] != '\0') fprintf(outf,"ssh-%s %s %.*s\n", alg, uu, (int) sizeof obj->label, obj->label);