@@ -2387,7 +2387,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
2387
2387
2388
2388
// OpenSSL takes control of the pointer after accepting it
2389
2389
char * data = node::Malloc (len);
2390
- CHECK_NE (data, nullptr );
2391
2390
memcpy (data, resp, len);
2392
2391
2393
2392
if (!SSL_set_tlsext_status_ocsp_resp (s, data, len))
@@ -3467,7 +3466,6 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
3467
3466
return false ;
3468
3467
*out_len = auth_tag_len_;
3469
3468
*out = node::Malloc (auth_tag_len_);
3470
- CHECK_NE (*out, nullptr );
3471
3469
memcpy (*out, auth_tag_, auth_tag_len_);
3472
3470
return true ;
3473
3471
}
@@ -5139,7 +5137,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
5139
5137
int field_size = EC_GROUP_get_degree (ecdh->group_ );
5140
5138
size_t out_len = (field_size + 7 ) / 8 ;
5141
5139
char * out = node::Malloc (out_len);
5142
- CHECK_NE (out, nullptr );
5143
5140
5144
5141
int r = ECDH_compute_key (out, out_len, pub, ecdh->key_ , nullptr );
5145
5142
EC_POINT_free (pub);
@@ -5175,7 +5172,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
5175
5172
return env->ThrowError (" Failed to get public key length" );
5176
5173
5177
5174
unsigned char * out = node::Malloc<unsigned char >(size);
5178
- CHECK_NE (out, nullptr );
5179
5175
5180
5176
int r = EC_POINT_point2oct (ecdh->group_ , pub, form, out, size, nullptr );
5181
5177
if (r != size) {
@@ -5201,7 +5197,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
5201
5197
5202
5198
int size = BN_num_bytes (b);
5203
5199
unsigned char * out = node::Malloc<unsigned char >(size);
5204
- CHECK_NE (out, nullptr );
5205
5200
5206
5201
if (size != BN_bn2bin (b, out)) {
5207
5202
free (out);
@@ -5335,8 +5330,6 @@ class PBKDF2Request : public AsyncWrap {
5335
5330
keylen_(keylen),
5336
5331
key_(node::Malloc(keylen)),
5337
5332
iter_(iter) {
5338
- if (key () == nullptr )
5339
- FatalError (" node::PBKDF2Request()" , " Out of Memory" );
5340
5333
Wrap (object, this );
5341
5334
}
5342
5335
@@ -5497,9 +5490,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5497
5490
THROW_AND_RETURN_IF_NOT_BUFFER (args[1 ], " Salt" );
5498
5491
5499
5492
pass = node::Malloc (passlen);
5500
- if (pass == nullptr ) {
5501
- FatalError (" node::PBKDF2()" , " Out of Memory" );
5502
- }
5503
5493
memcpy (pass, Buffer::Data (args[0 ]), passlen);
5504
5494
5505
5495
saltlen = Buffer::Length (args[1 ]);
@@ -5509,9 +5499,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5509
5499
}
5510
5500
5511
5501
salt = node::Malloc (saltlen);
5512
- if (salt == nullptr ) {
5513
- FatalError (" node::PBKDF2()" , " Out of Memory" );
5514
- }
5515
5502
memcpy (salt, Buffer::Data (args[1 ]), saltlen);
5516
5503
5517
5504
if (!args[2 ]->IsNumber ()) {
@@ -5602,8 +5589,6 @@ class RandomBytesRequest : public AsyncWrap {
5602
5589
error_ (0 ),
5603
5590
size_(size),
5604
5591
data_(node::Malloc(size)) {
5605
- if (data () == nullptr )
5606
- FatalError (" node::RandomBytesRequest()" , " Out of Memory" );
5607
5592
Wrap (object, this );
5608
5593
}
5609
5594
@@ -5830,8 +5815,6 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
5830
5815
if (num_curves) {
5831
5816
curves = node::Malloc<EC_builtin_curve>(num_curves);
5832
5817
5833
- CHECK_NE (curves, nullptr );
5834
-
5835
5818
if (EC_get_builtin_curves (curves, num_curves)) {
5836
5819
for (size_t i = 0 ; i < num_curves; i++) {
5837
5820
arr->Set (i, OneByteString (env->isolate (), OBJ_nid2sn (curves[i].nid )));
0 commit comments