From 935e28520b7bf00b4fc9b129e75ef6a7372cee25 Mon Sep 17 00:00:00 2001 From: Zoltan Fridrich Date: Mon, 4 Mar 2024 14:17:30 +0100 Subject: [PATCH] Fix some compiler warnings Signed-off-by: Zoltan Fridrich --- common/compat.c | 2 +- p11-kit/rpc-client.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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 }