Skip to content

Commit 8006cb0

Browse files
Jake ChampionJakeChampion
authored andcommitted
call JS_free on signature if EVP_PKEY_sign failed
1 parent a885209 commit 8006cb0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

c-dependencies/js-compute-runtime/builtins/crypto-algorithm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ JSObject *CryptoAlgorithmRSASSA_PKCS1_v1_5_Sign_Verify::sign(JSContext *cx, JS::
639639
if (EVP_PKEY_sign(ctx, signature, &signature_length, digest.data(), digest.size()) <= 0) {
640640
// TODO Rename error to OperationError
641641
JS_ReportErrorLatin1(cx, "OperationError");
642+
JS_free(cx, signature);
642643
return nullptr;
643644
}
644645

0 commit comments

Comments
 (0)