pkcs15-tool.c: fixed potential resource leak
This commit is contained in:
parent
5399c264fb
commit
4ca7daf31c
|
@ -828,8 +828,10 @@ static void print_ssh_key(FILE *outf, const char * alg, struct sc_pkcs15_object
|
||||||
// Old style openssh - [<quote protected options> <whitespace> <keytype> <whitespace> <key> [<whitespace> anything else]
|
// Old style openssh - [<quote protected options> <whitespace> <keytype> <whitespace> <key> [<whitespace> anything else]
|
||||||
//
|
//
|
||||||
r = sc_base64_encode(buf, len, uu, 2*len, 0);
|
r = sc_base64_encode(buf, len, uu, 2*len, 0);
|
||||||
if (r < 0)
|
if (r < 0) {
|
||||||
|
free(uu);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (obj->label[0] != '\0')
|
if (obj->label[0] != '\0')
|
||||||
fprintf(outf,"ssh-%s %s %.*s\n", alg, uu, (int) sizeof obj->label, obj->label);
|
fprintf(outf,"ssh-%s %s %.*s\n", alg, uu, (int) sizeof obj->label, obj->label);
|
||||||
|
|
Loading…
Reference in New Issue