@@ -2280,7 +2280,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
2280
2280
2281
2281
// OpenSSL takes control of the pointer after accepting it
2282
2282
char * data = node::Malloc (len);
2283
- CHECK_NE (data, nullptr );
2284
2283
memcpy (data, resp, len);
2285
2284
2286
2285
if (!SSL_set_tlsext_status_ocsp_resp (s, data, len))
@@ -3331,7 +3330,6 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
3331
3330
return false ;
3332
3331
*out_len = auth_tag_len_;
3333
3332
*out = node::Malloc (auth_tag_len_);
3334
- CHECK_NE (*out, nullptr );
3335
3333
memcpy (*out, auth_tag_, auth_tag_len_);
3336
3334
return true ;
3337
3335
}
@@ -4907,7 +4905,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
4907
4905
int field_size = EC_GROUP_get_degree (ecdh->group_ );
4908
4906
size_t out_len = (field_size + 7 ) / 8 ;
4909
4907
char * out = node::Malloc (out_len);
4910
- CHECK_NE (out, nullptr );
4911
4908
4912
4909
int r = ECDH_compute_key (out, out_len, pub, ecdh->key_ , nullptr );
4913
4910
EC_POINT_free (pub);
@@ -4943,7 +4940,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
4943
4940
return env->ThrowError (" Failed to get public key length" );
4944
4941
4945
4942
unsigned char * out = node::Malloc<unsigned char >(size);
4946
- CHECK_NE (out, nullptr );
4947
4943
4948
4944
int r = EC_POINT_point2oct (ecdh->group_ , pub, form, out, size, nullptr );
4949
4945
if (r != size) {
@@ -4969,7 +4965,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
4969
4965
4970
4966
int size = BN_num_bytes (b);
4971
4967
unsigned char * out = node::Malloc<unsigned char >(size);
4972
- CHECK_NE (out, nullptr );
4973
4968
4974
4969
if (size != BN_bn2bin (b, out)) {
4975
4970
free (out);
@@ -5101,8 +5096,6 @@ class PBKDF2Request : public AsyncWrap {
5101
5096
keylen_(keylen),
5102
5097
key_(node::Malloc(keylen)),
5103
5098
iter_(iter) {
5104
- if (key () == nullptr )
5105
- FatalError (" node::PBKDF2Request()" , " Out of Memory" );
5106
5099
Wrap (object, this );
5107
5100
}
5108
5101
@@ -5263,9 +5256,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5263
5256
THROW_AND_RETURN_IF_NOT_BUFFER (args[1 ], " Salt" );
5264
5257
5265
5258
pass = node::Malloc (passlen);
5266
- if (pass == nullptr ) {
5267
- FatalError (" node::PBKDF2()" , " Out of Memory" );
5268
- }
5269
5259
memcpy (pass, Buffer::Data (args[0 ]), passlen);
5270
5260
5271
5261
saltlen = Buffer::Length (args[1 ]);
@@ -5275,9 +5265,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
5275
5265
}
5276
5266
5277
5267
salt = node::Malloc (saltlen);
5278
- if (salt == nullptr ) {
5279
- FatalError (" node::PBKDF2()" , " Out of Memory" );
5280
- }
5281
5268
memcpy (salt, Buffer::Data (args[1 ]), saltlen);
5282
5269
5283
5270
if (!args[2 ]->IsNumber ()) {
@@ -5368,8 +5355,6 @@ class RandomBytesRequest : public AsyncWrap {
5368
5355
error_ (0 ),
5369
5356
size_(size),
5370
5357
data_(node::Malloc(size)) {
5371
- if (data () == nullptr )
5372
- FatalError (" node::RandomBytesRequest()" , " Out of Memory" );
5373
5358
Wrap (object, this );
5374
5359
}
5375
5360
@@ -5596,8 +5581,6 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
5596
5581
if (num_curves) {
5597
5582
curves = node::Malloc<EC_builtin_curve>(num_curves);
5598
5583
5599
- CHECK_NE (curves, nullptr );
5600
-
5601
5584
if (EC_get_builtin_curves (curves, num_curves)) {
5602
5585
for (size_t i = 0 ; i < num_curves; i++) {
5603
5586
arr->Set (i, OneByteString (env->isolate (), OBJ_nid2sn (curves[i].nid )));
0 commit comments