diff --git a/src/util.c b/src/util.c index 66a3bd0f..3039f9fd 100644 --- a/src/util.c +++ b/src/util.c @@ -110,13 +110,8 @@ CK_RV p11prov_fetch_attributes(P11PROV_CTX *ctx, P11PROV_SESSION *session, ret = CKR_OK; } done: - if (ret == CKR_OK) { - /* if there was any error, remove it, as we got success */ - p11prov_pop_error_to_mark(ctx); - } else { - /* otherwise clear the mark and leave errors on the stack */ - p11prov_clear_last_error_mark(ctx); - } + /* if there was any error, remove it, as it will be handled by the caller */ + p11prov_pop_error_to_mark(ctx); return ret; }