remove pointer to freed secret object

Patch supplied by Victor Tarasov


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1771 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2004-04-18 18:42:47 +00:00
parent 2daf4c814d
commit effbc2a7b6
1 changed files with 2 additions and 0 deletions

View File

@ -324,6 +324,8 @@ 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)
named_pin[s->named_pin] = NULL;
memset(s, 0, sizeof(*s));
free(s);
} else {