diff --git a/common/compat.c b/common/compat.c index f4a113eb..6b39a7b3 100644 --- a/common/compat.c +++ b/common/compat.c @@ -332,7 +332,7 @@ p11_dl_error (void) MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msg_buf, 0, NULL); - if (msg_buf == NULL); + if (msg_buf == NULL) return NULL; result = strdup (msg_buf); diff --git a/p11-kit/rpc-client.c b/p11-kit/rpc-client.c index 19b628b1..82aaf2bd 100644 --- a/p11-kit/rpc-client.c +++ b/p11-kit/rpc-client.c @@ -789,10 +789,11 @@ rpc_C_Initialize (CK_X_FUNCTION_LIST *self, assert (module->vtable->disconnect != NULL); (module->vtable->disconnect) (module->vtable, reserved); ret = (module->vtable->connect) (module->vtable, reserved); - - module->version = 0; - ret = (module->vtable->authenticate) (module->vtable, - &module->version); + if (ret == CKR_OK) { + module->version = 0; + ret = (module->vtable->authenticate) (module->vtable, + &module->version); + } } #endif }