From b8133c2545e18fdf5294a6478eeab09bec60c8e6 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 27 Sep 2018 11:47:44 +0200 Subject: [PATCH] pkcs15-myeid: Return value checking --- src/pkcs15init/pkcs15-myeid.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pkcs15init/pkcs15-myeid.c b/src/pkcs15init/pkcs15-myeid.c index a7da3c6c..8b927d09 100644 --- a/src/pkcs15init/pkcs15-myeid.c +++ b/src/pkcs15init/pkcs15-myeid.c @@ -434,7 +434,11 @@ _add_supported_algo(struct sc_profile *profile, struct sc_pkcs15_card *p15card, unsigned operations, unsigned mechanism, const struct sc_object_id *oid) { struct sc_supported_algo_info *algo; + struct sc_context *ctx = p15card->card->ctx; algo = sc_pkcs15_get_supported_algo(p15card, operations, mechanism); + int rv; + + LOG_FUNC_CALLED(ctx); if (!algo) { unsigned ref = 1, ii; @@ -452,7 +456,10 @@ _add_supported_algo(struct sc_profile *profile, struct sc_pkcs15_card *p15card, } } - sc_pkcs15_add_supported_algo_ref(object, algo); + rv = sc_pkcs15_add_supported_algo_ref(object, algo); + if (rv != SC_SUCCESS) { + sc_log(ctx, "Failed to add algorithms refs"); + } } static void