Skip to content

Commit a885209

Browse files
Jake ChampionJakeChampion
authored andcommitted
use js_malloc as we later use js_free on this piece of memory
1 parent 4f2f93d commit a885209

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ JSObject *CryptoAlgorithmRSASSA_PKCS1_v1_5_Sign_Verify::sign(JSContext *cx, JS::
635635
}
636636

637637
// 4. Let signature be the value S that results from performing the operation.
638-
uint8_t *signature = reinterpret_cast<uint8_t *>(calloc(signature_length, sizeof(uint8_t)));
638+
uint8_t *signature = reinterpret_cast<uint8_t *>(JS_malloc(cx, signature_length));
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");

0 commit comments

Comments
 (0)