mirror of git://git.gnupg.org/gnupg.git
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:
parent
684a52dffa
commit
c5e8ef3ab9
|
@ -1451,6 +1451,7 @@ static int
|
||||||
close_ccid_reader (int slot)
|
close_ccid_reader (int slot)
|
||||||
{
|
{
|
||||||
ccid_close_reader (reader_table[slot].ccid.handle);
|
ccid_close_reader (reader_table[slot].ccid.handle);
|
||||||
|
reader_table[slot].ccid.handle = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1613,7 +1614,10 @@ open_ccid_reader (struct dev_list *dl, int *r_cciderr)
|
||||||
err = ccid_get_atr (slotp->ccid.handle,
|
err = ccid_get_atr (slotp->ccid.handle,
|
||||||
slotp->atr, sizeof slotp->atr, &slotp->atrlen);
|
slotp->atr, sizeof slotp->atr, &slotp->atrlen);
|
||||||
if (err)
|
if (err)
|
||||||
ccid_close_reader (slotp->ccid.handle);
|
{
|
||||||
|
ccid_close_reader (slotp->ccid.handle);
|
||||||
|
slotp->ccid.handle = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in New Issue