@@ -2279,7 +2279,7 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
2279
2279
size_t len = Buffer::Length (obj);
2280
2280
2281
2281
// OpenSSL takes control of the pointer after accepting it
2282
- char * data = reinterpret_cast <char *>(malloc (len));
2282
+ char * data = reinterpret_cast <char *>(node::Malloc (len));
2283
2283
CHECK_NE (data, nullptr );
2284
2284
memcpy (data, resp, len);
2285
2285
@@ -3330,7 +3330,7 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
3330
3330
if (initialised_ || kind_ != kCipher || !auth_tag_)
3331
3331
return false ;
3332
3332
*out_len = auth_tag_len_;
3333
- *out = static_cast <char *>(malloc (auth_tag_len_));
3333
+ *out = static_cast <char *>(node::Malloc (auth_tag_len_));
3334
3334
CHECK_NE (*out, nullptr );
3335
3335
memcpy (*out, auth_tag_, auth_tag_len_);
3336
3336
return true ;
@@ -4906,7 +4906,7 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
4906
4906
// NOTE: field_size is in bits
4907
4907
int field_size = EC_GROUP_get_degree (ecdh->group_ );
4908
4908
size_t out_len = (field_size + 7 ) / 8 ;
4909
- char * out = static_cast <char *>(malloc (out_len));
4909
+ char * out = static_cast <char *>(node::Malloc (out_len));
4910
4910
CHECK_NE (out, nullptr );
4911
4911
4912
4912
int r = ECDH_compute_key (out, out_len, pub, ecdh->key_ , nullptr );
@@ -4942,7 +4942,7 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
4942
4942
if (size == 0 )
4943
4943
return env->ThrowError (" Failed to get public key length" );
4944
4944
4945
- unsigned char * out = static_cast <unsigned char *>(malloc (size));
4945
+ unsigned char * out = static_cast <unsigned char *>(node::Malloc (size));
4946
4946
CHECK_NE (out, nullptr );
4947
4947
4948
4948
int r = EC_POINT_point2oct (ecdh->group_ , pub, form, out, size, nullptr );
@@ -4968,7 +4968,7 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
4968
4968
return env->ThrowError (" Failed to get ECDH private key" );
4969
4969
4970
4970
int size = BN_num_bytes (b);
4971
- unsigned char * out = static_cast <unsigned char *>(malloc (size));
4971
+ unsigned char * out = static_cast <unsigned char *>(node::Malloc (size));
4972
4972
CHECK_NE (out, nullptr );
4973
4973
4974
4974
if (size != BN_bn2bin (b, out)) {
@@ -5099,7 +5099,7 @@ class PBKDF2Request : public AsyncWrap {
5099
5099
saltlen_(saltlen),
5100
5100
salt_(salt),
5101
5101
keylen_(keylen),
5102
- key_(static_cast <char *>(malloc (keylen))),
5102
+ key_(static_cast <char *>(node::Malloc (keylen))),
5103
5103
iter_(iter) {
5104
5104
if (key () == nullptr )
5105
5105
FatalError (" node::PBKDF2Request()" , " Out of Memory" );
@@ -5262,7 +5262,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5262
5262
5263
5263
THROW_AND_RETURN_IF_NOT_BUFFER (args[1 ], " Salt" );
5264
5264
5265
- pass = static_cast <char *>(malloc (passlen));
5265
+ pass = static_cast <char *>(node::Malloc (passlen));
5266
5266
if (pass == nullptr ) {
5267
5267
FatalError (" node::PBKDF2()" , " Out of Memory" );
5268
5268
}
@@ -5274,7 +5274,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5274
5274
goto err;
5275
5275
}
5276
5276
5277
- salt = static_cast <char *>(malloc (saltlen));
5277
+ salt = static_cast <char *>(node::Malloc (saltlen));
5278
5278
if (salt == nullptr ) {
5279
5279
FatalError (" node::PBKDF2()" , " Out of Memory" );
5280
5280
}
@@ -5367,7 +5367,7 @@ class RandomBytesRequest : public AsyncWrap {
5367
5367
: AsyncWrap(env, object, AsyncWrap::PROVIDER_CRYPTO),
5368
5368
error_ (0 ),
5369
5369
size_(size),
5370
- data_(static_cast <char *>(malloc (size))) {
5370
+ data_(static_cast <char *>(node::Malloc (size))) {
5371
5371
if (data () == nullptr )
5372
5372
FatalError (" node::RandomBytesRequest()" , " Out of Memory" );
5373
5373
Wrap (object, this );
@@ -5596,7 +5596,7 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
5596
5596
5597
5597
if (num_curves) {
5598
5598
alloc_size = sizeof (*curves) * num_curves;
5599
- curves = static_cast <EC_builtin_curve*>(malloc (alloc_size));
5599
+ curves = static_cast <EC_builtin_curve*>(node::Malloc (alloc_size));
5600
5600
5601
5601
CHECK_NE (curves, nullptr );
5602
5602
0 commit comments