openpgp-tool: fixed resource leak

VTA: slightly touched, original commit f0ddbf4
This commit is contained in:
Frank Morgner 2015-04-29 23:22:29 +02:00 committed by Viktor Tarasov
parent b0a708b0bb
commit c65caed7f4
1 changed files with 3 additions and 4 deletions

View File

@ -378,10 +378,9 @@ static int do_dump_do(sc_card_t *card, unsigned int tag)
}
dup2(tmp, fileno(stdout));
clearerr(stdout);
if (sizeof(buffer) != r) {
return EXIT_FAILURE;
}
close(tmp);
if (sizeof(buffer) != r)
return EXIT_FAILURE;
} else {
util_hex_dump_asc(stdout, buffer, sizeof(buffer), -1);
}