card-tcos: fixed resource leak
This commit is contained in:
parent
547494f012
commit
7fe4819a02
|
@ -402,6 +402,7 @@ static int tcos_select_file(sc_card_t *card,
|
|||
|
||||
file = sc_file_new();
|
||||
if (file == NULL) SC_FUNC_RETURN(ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_OUT_OF_MEMORY);
|
||||
*file_out = file;
|
||||
file->path = *in_path;
|
||||
|
||||
for(i=2; i+1<apdu.resplen && i+1+apdu.resp[i+1]<apdu.resplen; i+=2+apdu.resp[i+1]){
|
||||
|
@ -440,7 +441,6 @@ static int tcos_select_file(sc_card_t *card,
|
|||
}
|
||||
}
|
||||
file->magic = SC_FILE_MAGIC;
|
||||
*file_out = file;
|
||||
|
||||
parse_sec_attr(card, file, file->sec_attr, file->sec_attr_len);
|
||||
|
||||
|
|
Loading…
Reference in New Issue