Don't free file if pointer is null (#858)

Protect against segmentation

closes #854.
This commit is contained in:
Ian Young 2016-08-27 22:14:04 +01:00 committed by Frank Morgner
parent 98568fe13e
commit f64c71da28
1 changed files with 1 additions and 1 deletions

View File

@ -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 */