When forgetting PIN set to 'null' the corresponding named_pin's entry

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3048 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
vtarasov 2006-11-02 09:19:17 +00:00
parent ef012c94f5
commit 71aab076aa
1 changed files with 1 additions and 1 deletions

View File

@ -331,7 +331,7 @@ sc_keycache_forget_key(const sc_path_t *path, int type, int ref)
while ((s = *prev) != NULL) {
if (__match_entry(s, type, ref, path, 1)) {
*prev = s->next;
if (s->named_pin != -1 && s->ref == -1)
if (s->named_pin >= 0 && s->named_pin < SC_PKCS15INIT_NPINS)
named_pin[s->named_pin] = NULL;
sc_mem_clear(s, sizeof(*s));
free(s);