Skip to content

Commit

Permalink
Merge pull request softhsm#677 from dcoombs/develop
Browse files Browse the repository at this point in the history
Fix memory leak in SoftHSM::UnwrapKeySym.
  • Loading branch information
halderen authored Aug 2, 2023
2 parents 8224ebe + fbca80b commit f4661af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/SoftHSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6831,9 +6831,10 @@ CK_RV SoftHSM::UnwrapKeySym
rv = CKR_OK;
if (!cipher->unwrapKey(unwrappingkey, mode, wrapped, keydata))
rv = CKR_GENERAL_ERROR;
cipher->recycleKey(unwrappingkey);
CryptoFactory::i()->recycleSymmetricAlgorithm(cipher);
}

cipher->recycleKey(unwrappingkey);
CryptoFactory::i()->recycleSymmetricAlgorithm(cipher);
return rv;
}

Expand Down

0 comments on commit f4661af

Please sign in to comment.