Aktiv Co./Aleksey Samsonov:

fix a bug in rutoken driver.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3711 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2009-07-22 12:24:33 +00:00
parent 16f045bf0c
commit 0c2fe83c3b
2 changed files with 8 additions and 1 deletions

View File

@ -39,9 +39,14 @@
*/
static int rtecp_erase(sc_profile_t *profile, sc_card_t *card)
{
int r;
if (!profile || !card)
return SC_ERROR_INVALID_ARGUMENTS;
return sc_card_ctl(card, SC_CARDCTL_RTECP_INIT, NULL);
r = sc_card_ctl(card, SC_CARDCTL_RTECP_INIT, NULL);
if (r == SC_SUCCESS)
sc_free_apps(card);
return r;
}
static int create_sysdf(sc_profile_t *profile, sc_card_t *card, const char *name)

View File

@ -465,6 +465,8 @@ rutoken_erase(struct sc_profile *profile, sc_card_t *card)
}
if (ret != SC_SUCCESS)
sc_error(card->ctx, "Failed to erase: %s\n", sc_strerror(ret));
else
sc_free_apps(card);
return ret;
}