pkcs15-tool: coverity scan warning RESOURCE-LEAK

Coverity scan CID 402622: Resource leak (RESOURCE_LEAK)
This commit is contained in:
Viktor Tarasov 2012-06-11 20:04:08 +02:00
parent 62eb0d05d7
commit c6f4e09477
1 changed files with 4 additions and 0 deletions

View File

@ -811,10 +811,14 @@ static int read_ssh_key(void)
}
if (r == SC_ERROR_OBJECT_NOT_FOUND) {
if (outf != stdout)
fclose(outf);
fprintf(stderr, "Public key with ID '%s' not found.\n", opt_pubkey);
return 2;
}
if (r < 0) {
if (outf != stdout)
fclose(outf);
fprintf(stderr, "Public key enumeration failed: %s\n", sc_strerror(r));
return 1;
}