Skip to content

Commit 3909bd2

Browse files
Merge pull request ladislav-zezula#434 from sjoblomj/free-rsa
Fixing memory leak
2 parents 1df38c1 + e6b12f4 commit 3909bd2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/SFileVerify.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ static DWORD VerifyStrongSignatureWithKey(
481481

482482
// Verify the signature
483483
if(rsa_verify_simple(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE, padded_digest, MPQ_STRONG_SIGNATURE_SIZE, &result, &key) != CRYPT_OK)
484+
{
485+
rsa_free(&key);
484486
return ERROR_VERIFY_FAILED;
487+
}
485488

486489
// Free the key and return result
487490
rsa_free(&key);

0 commit comments

Comments
 (0)