scd: Internal CCID: Clear the handle after use.

* scd/apdu.c (close_ccid_reader): Clear the handle.
(open_ccid_reader): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-09-28 13:33:20 +09:00
parent 684a52dffa
commit c5e8ef3ab9
1 changed files with 5 additions and 1 deletions

View File

@ -1451,6 +1451,7 @@ static int
close_ccid_reader (int slot)
{
ccid_close_reader (reader_table[slot].ccid.handle);
reader_table[slot].ccid.handle = NULL;
return 0;
}
@ -1613,7 +1614,10 @@ open_ccid_reader (struct dev_list *dl, int *r_cciderr)
err = ccid_get_atr (slotp->ccid.handle,
slotp->atr, sizeof slotp->atr, &slotp->atrlen);
if (err)
ccid_close_reader (slotp->ccid.handle);
{
ccid_close_reader (slotp->ccid.handle);
slotp->ccid.handle = NULL;
}
}
if (err)