@@ -2280,7 +2280,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
22802280
22812281 // OpenSSL takes control of the pointer after accepting it
22822282 char * data = node::Malloc (len);
2283- CHECK_NE (data, nullptr );
22842283 memcpy (data, resp, len);
22852284
22862285 if (!SSL_set_tlsext_status_ocsp_resp (s, data, len))
@@ -3331,7 +3330,6 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
33313330 return false ;
33323331 *out_len = auth_tag_len_;
33333332 *out = node::Malloc (auth_tag_len_);
3334- CHECK_NE (*out, nullptr );
33353333 memcpy (*out, auth_tag_, auth_tag_len_);
33363334 return true ;
33373335}
@@ -4907,7 +4905,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
49074905 int field_size = EC_GROUP_get_degree (ecdh->group_ );
49084906 size_t out_len = (field_size + 7 ) / 8 ;
49094907 char * out = node::Malloc (out_len);
4910- CHECK_NE (out, nullptr );
49114908
49124909 int r = ECDH_compute_key (out, out_len, pub, ecdh->key_ , nullptr );
49134910 EC_POINT_free (pub);
@@ -4943,7 +4940,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
49434940 return env->ThrowError (" Failed to get public key length" );
49444941
49454942 unsigned char * out = node::Malloc<unsigned char >(size);
4946- CHECK_NE (out, nullptr );
49474943
49484944 int r = EC_POINT_point2oct (ecdh->group_ , pub, form, out, size, nullptr );
49494945 if (r != size) {
@@ -4969,7 +4965,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
49694965
49704966 int size = BN_num_bytes (b);
49714967 unsigned char * out = node::Malloc<unsigned char >(size);
4972- CHECK_NE (out, nullptr );
49734968
49744969 if (size != BN_bn2bin (b, out)) {
49754970 free (out);
@@ -5101,8 +5096,6 @@ class PBKDF2Request : public AsyncWrap {
51015096 keylen_(keylen),
51025097 key_(node::Malloc(keylen)),
51035098 iter_(iter) {
5104- if (key () == nullptr )
5105- FatalError (" node::PBKDF2Request()" , " Out of Memory" );
51065099 Wrap (object, this );
51075100 }
51085101
@@ -5263,9 +5256,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
52635256 THROW_AND_RETURN_IF_NOT_BUFFER (args[1 ], " Salt" );
52645257
52655258 pass = node::Malloc (passlen);
5266- if (pass == nullptr ) {
5267- FatalError (" node::PBKDF2()" , " Out of Memory" );
5268- }
52695259 memcpy (pass, Buffer::Data (args[0 ]), passlen);
52705260
52715261 saltlen = Buffer::Length (args[1 ]);
@@ -5275,9 +5265,6 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
52755265 }
52765266
52775267 salt = node::Malloc (saltlen);
5278- if (salt == nullptr ) {
5279- FatalError (" node::PBKDF2()" , " Out of Memory" );
5280- }
52815268 memcpy (salt, Buffer::Data (args[1 ]), saltlen);
52825269
52835270 if (!args[2 ]->IsNumber ()) {
@@ -5368,8 +5355,6 @@ class RandomBytesRequest : public AsyncWrap {
53685355 error_ (0 ),
53695356 size_(size),
53705357 data_(node::Malloc(size)) {
5371- if (data () == nullptr )
5372- FatalError (" node::RandomBytesRequest()" , " Out of Memory" );
53735358 Wrap (object, this );
53745359 }
53755360
@@ -5596,8 +5581,6 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
55965581 if (num_curves) {
55975582 curves = node::Malloc<EC_builtin_curve>(num_curves);
55985583
5599- CHECK_NE (curves, nullptr );
5600-
56015584 if (EC_get_builtin_curves (curves, num_curves)) {
56025585 for (size_t i = 0 ; i < num_curves; i++) {
56035586 arr->Set (i, OneByteString (env->isolate (), OBJ_nid2sn (curves[i].nid )));
0 commit comments