From ef724e1e57ae5e56de40be6a58527716c9f62112 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 27 Sep 2018 15:56:16 +0200 Subject: [PATCH] pkcs15-authentic: Do not confuse static analyzers --- src/pkcs15init/pkcs15-authentic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pkcs15init/pkcs15-authentic.c b/src/pkcs15init/pkcs15-authentic.c index 0b6f9c17..a92c221c 100644 --- a/src/pkcs15init/pkcs15-authentic.c +++ b/src/pkcs15init/pkcs15-authentic.c @@ -555,7 +555,10 @@ authentic_pkcs15_create_key(struct sc_profile *profile, struct sc_pkcs15_card *p | SC_PKCS15_PRKEY_ACCESS_SENSITIVE; rv = authentic_sdo_allocate_prvkey(profile, card, key_info, &sdo); - LOG_TEST_RET(ctx, rv, "IasEcc: init SDO private key failed"); + if (rv != SC_SUCCESS || sdo == NULL) { + sc_log(ctx, "IasEcc: init SDO private key failed"); + LOG_FUNC_RETURN(ctx, rv); + } rv = sc_card_ctl(card, SC_CARDCTL_AUTHENTIC_SDO_CREATE, sdo); if (rv == SC_ERROR_FILE_ALREADY_EXISTS) {