pkcs11-tool: Call C_Finalize when a fatal error happens. (Otherwise OSX pcsc locks up)

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3908 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2010-01-15 09:22:03 +00:00
parent c6a0e54f9a
commit e595042474
1 changed files with 5 additions and 0 deletions

View File

@ -3457,6 +3457,11 @@ static const char *p11_utf8_to_local(CK_UTF8CHAR *string, size_t len)
static void p11_fatal(const char *func, CK_RV rv)
{
if (p11)
p11->C_Finalize(NULL_PTR);
if (module)
C_UnloadModule(module);
util_fatal("PKCS11 function %s failed: rv = %s (0x%0x)\n",
func, CKR2Str(rv), (unsigned int) rv);
}