Don't free file if pointer is null (#858)
Protect against segmentation closes #854.
This commit is contained in:
parent
98568fe13e
commit
f64c71da28
|
@ -493,7 +493,7 @@ static int entersafe_select_fid(sc_card_t *card,
|
|||
path.len=2;
|
||||
|
||||
r = iso_ops->select_file(card,&path,&file);
|
||||
if(r) sc_file_free(file);
|
||||
if(r && file) sc_file_free(file);
|
||||
SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed");
|
||||
|
||||
/* update cache */
|
||||
|
|
Loading…
Reference in New Issue