fixed memory leak

This commit is contained in:
Frank Morgner 2018-07-17 13:31:14 +02:00
parent 3042a39705
commit 16275c2683
1 changed files with 6 additions and 4 deletions

View File

@ -732,7 +732,7 @@ static int do_cd(int argc, char **argv)
static int read_and_util_print_binary_file(sc_file_t *file)
{
unsigned char *buf = NULL;
int r;
int r, ret = -1;
size_t size;
if (file->size) {
@ -750,15 +750,17 @@ static int read_and_util_print_binary_file(sc_file_t *file)
sc_unlock(card);
if (r < 0) {
check_ret(r, SC_AC_OP_READ, "read failed", file);
return -1;
goto err;
}
if ((r == 0) && (card->type == SC_CARD_TYPE_BELPIC_EID))
return -1;
goto err;
util_hex_dump_asc(stdout, buf, r, 0);
ret = 0;
err:
free(buf);
return 0;
return ret;
}
static int read_and_print_record_file(sc_file_t *file, unsigned char sfi)