diff --git a/src/slot.c b/src/slot.c index ddab71ec..8974fb3b 100644 --- a/src/slot.c +++ b/src/slot.c @@ -187,11 +187,13 @@ CK_RV p11prov_init_slots(P11PROV_CTX *ctx, P11PROV_SLOTS_CTX **slots) ret = p11prov_GetSlotInfo(ctx, slotid[i], &slot->slot); if (ret != CKR_OK || (slot->slot.flags & CKF_TOKEN_PRESENT) == 0) { /* skip slot */ + OPENSSL_free(slot); continue; } ret = p11prov_GetTokenInfo(ctx, slotid[i], &slot->token); if (ret) { /* skip slot */ + OPENSSL_free(slot); continue; }