@@ -2387,7 +2387,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
23872387
23882388 // OpenSSL takes control of the pointer after accepting it
23892389 char * data = node::Malloc (len);
2390- CHECK_NE (data, nullptr );
23912390 memcpy (data, resp, len);
23922391
23932392 if (!SSL_set_tlsext_status_ocsp_resp (s, data, len))
@@ -3467,7 +3466,6 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
34673466 return false ;
34683467 *out_len = auth_tag_len_;
34693468 *out = node::Malloc (auth_tag_len_);
3470- CHECK_NE (*out, nullptr );
34713469 memcpy (*out, auth_tag_, auth_tag_len_);
34723470 return true ;
34733471}
@@ -5139,7 +5137,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
51395137 int field_size = EC_GROUP_get_degree (ecdh->group_ );
51405138 size_t out_len = (field_size + 7 ) / 8 ;
51415139 char * out = node::Malloc (out_len);
5142- CHECK_NE (out, nullptr );
51435140
51445141 int r = ECDH_compute_key (out, out_len, pub, ecdh->key_ , nullptr );
51455142 EC_POINT_free (pub);
@@ -5175,7 +5172,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
51755172 return env->ThrowError (" Failed to get public key length" );
51765173
51775174 unsigned char * out = node::Malloc<unsigned char >(size);
5178- CHECK_NE (out, nullptr );
51795175
51805176 int r = EC_POINT_point2oct (ecdh->group_ , pub, form, out, size, nullptr );
51815177 if (r != size) {
@@ -5201,7 +5197,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
52015197
52025198 int size = BN_num_bytes (b);
52035199 unsigned char * out = node::Malloc<unsigned char >(size);
5204- CHECK_NE (out, nullptr );
52055200
52065201 if (size != BN_bn2bin (b, out)) {
52075202 free (out);
@@ -5335,8 +5330,6 @@ class PBKDF2Request : public AsyncWrap {
53355330 keylen_(keylen),
53365331 key_(node::Malloc(keylen)),
53375332 iter_(iter) {
5338- if (key () == nullptr )
5339- FatalError (" node::PBKDF2Request()" , " Out of Memory" );
53405333 Wrap (object, this );
53415334 }
53425335
@@ -5497,9 +5490,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
54975490 THROW_AND_RETURN_IF_NOT_BUFFER (args[1 ], " Salt" );
54985491
54995492 pass = node::Malloc (passlen);
5500- if (pass == nullptr ) {
5501- FatalError (" node::PBKDF2()" , " Out of Memory" );
5502- }
55035493 memcpy (pass, Buffer::Data (args[0 ]), passlen);
55045494
55055495 saltlen = Buffer::Length (args[1 ]);
@@ -5509,9 +5499,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
55095499 }
55105500
55115501 salt = node::Malloc (saltlen);
5512- if (salt == nullptr ) {
5513- FatalError (" node::PBKDF2()" , " Out of Memory" );
5514- }
55155502 memcpy (salt, Buffer::Data (args[1 ]), saltlen);
55165503
55175504 if (!args[2 ]->IsNumber ()) {
@@ -5602,8 +5589,6 @@ class RandomBytesRequest : public AsyncWrap {
56025589 error_ (0 ),
56035590 size_(size),
56045591 data_(node::Malloc(size)) {
5605- if (data () == nullptr )
5606- FatalError (" node::RandomBytesRequest()" , " Out of Memory" );
56075592 Wrap (object, this );
56085593 }
56095594
@@ -5830,8 +5815,6 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
58305815 if (num_curves) {
58315816 curves = node::Malloc<EC_builtin_curve>(num_curves);
58325817
5833- CHECK_NE (curves, nullptr );
5834-
58355818 if (EC_get_builtin_curves (curves, num_curves)) {
58365819 for (size_t i = 0 ; i < num_curves; i++) {
58375820 arr->Set (i, OneByteString (env->isolate (), OBJ_nid2sn (curves[i].nid )));
0 commit comments