mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
scd: Fix close_pcsc_reader.
* scd/apdu.c (close_pcsc_reader): Don't touch .RDRNAME field. (apdu_dev_list_finish): Clear .RDRNAME field and replace call of close_pcsc_reader by release_pcsc_context. Add assertion. -- GnuPG-bug-id: 5416 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
cccc9bd5db
commit
ec5591dc4e
16
scd/apdu.c
16
scd/apdu.c
@ -842,14 +842,7 @@ close_pcsc_reader (int slot)
|
|||||||
(void)slot;
|
(void)slot;
|
||||||
log_assert (pcsc.count > 0);
|
log_assert (pcsc.count > 0);
|
||||||
if (!--pcsc.count)
|
if (!--pcsc.count)
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/*log_debug ("%s: releasing context\n", __func__);*/
|
|
||||||
release_pcsc_context ();
|
release_pcsc_context ();
|
||||||
for (i = 0; i < MAX_READER; i++)
|
|
||||||
pcsc.rdrname[i] = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2123,8 +2116,15 @@ apdu_dev_list_finish (struct dev_list *dl)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{ /* PC/SC readers. */
|
{ /* PC/SC readers. */
|
||||||
|
int i;
|
||||||
|
|
||||||
xfree (dl->table);
|
xfree (dl->table);
|
||||||
close_pcsc_reader (0);
|
for (i = 0; i < MAX_READER; i++)
|
||||||
|
pcsc.rdrname[i] = NULL;
|
||||||
|
|
||||||
|
log_assert (pcsc.count > 0);
|
||||||
|
if (--pcsc.count == 0)
|
||||||
|
release_pcsc_context ();
|
||||||
}
|
}
|
||||||
xfree (dl);
|
xfree (dl);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user