@ -2279,7 +2279,7 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
size_t len = Buffer : : Length ( obj ) ;
// OpenSSL takes control of the pointer after accepting it
char * data = reinterpret_cast < char * > ( node : : Malloc ( len ) ) ;
char * data = node : : Malloc ( len ) ;
CHECK_NE ( data , nullptr ) ;
memcpy ( data , resp , len ) ;
@ -3330,7 +3330,7 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
if ( initialised_ | | kind_ ! = kCipher | | ! auth_tag_ )
return false ;
* out_len = auth_tag_len_ ;
* out = static_cast < char * > ( node : : Malloc ( auth_tag_len_ ) ) ;
* out = node : : Malloc ( auth_tag_len_ ) ;
CHECK_NE ( * out , nullptr ) ;
memcpy ( * out , auth_tag_ , auth_tag_len_ ) ;
return true ;
@ -4906,7 +4906,7 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
// NOTE: field_size is in bits
int field_size = EC_GROUP_get_degree ( ecdh - > group_ ) ;
size_t out_len = ( field_size + 7 ) / 8 ;
char * out = static_cast < char * > ( node : : Malloc ( out_len ) ) ;
char * out = node : : Malloc ( out_len ) ;
CHECK_NE ( out , nullptr ) ;
int r = ECDH_compute_key ( out , out_len , pub , ecdh - > key_ , nullptr ) ;
@ -4942,7 +4942,7 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
if ( size = = 0 )
return env - > ThrowError ( " Failed to get public key length " ) ;
unsigned char * out = static_cast < unsigned char * > ( node : : Malloc ( size ) ) ;
unsigned char * out = node : : Malloc < unsigned char > ( size ) ;
CHECK_NE ( out , nullptr ) ;
int r = EC_POINT_point2oct ( ecdh - > group_ , pub , form , out , size , nullptr ) ;
@ -4968,7 +4968,7 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
return env - > ThrowError ( " Failed to get ECDH private key " ) ;
int size = BN_num_bytes ( b ) ;
unsigned char * out = static_cast < unsigned char * > ( node : : Malloc ( size ) ) ;
unsigned char * out = node : : Malloc < unsigned char > ( size ) ;
CHECK_NE ( out , nullptr ) ;
if ( size ! = BN_bn2bin ( b , out ) ) {
@ -5099,7 +5099,7 @@ class PBKDF2Request : public AsyncWrap {
saltlen_ ( saltlen ) ,
salt_ ( salt ) ,
keylen_ ( keylen ) ,
key_ ( static_cast < char * > ( node : : Malloc ( keylen ) ) ) ,
key_ ( node : : Malloc ( keylen ) ) ,
iter_ ( iter ) {
if ( key ( ) = = nullptr )
FatalError ( " node::PBKDF2Request() " , " Out of Memory " ) ;
@ -5262,7 +5262,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
THROW_AND_RETURN_IF_NOT_BUFFER ( args [ 1 ] , " Salt " ) ;
pass = static_cast < char * > ( node : : Malloc ( passlen ) ) ;
pass = node : : Malloc ( passlen ) ;
if ( pass = = nullptr ) {
FatalError ( " node::PBKDF2() " , " Out of Memory " ) ;
}
@ -5274,7 +5274,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
goto err ;
}
salt = static_cast < char * > ( node : : Malloc ( saltlen ) ) ;
salt = node : : Malloc ( saltlen ) ;
if ( salt = = nullptr ) {
FatalError ( " node::PBKDF2() " , " Out of Memory " ) ;
}
@ -5367,7 +5367,7 @@ class RandomBytesRequest : public AsyncWrap {
: AsyncWrap ( env , object , AsyncWrap : : PROVIDER_CRYPTO ) ,
error_ ( 0 ) ,
size_ ( size ) ,
data_ ( static_cast < char * > ( node : : Malloc ( size ) ) ) {
data_ ( node : : Malloc ( size ) ) {
if ( data ( ) = = nullptr )
FatalError ( " node::RandomBytesRequest() " , " Out of Memory " ) ;
Wrap ( object , this ) ;
@ -5594,8 +5594,7 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {
EC_builtin_curve * curves ;
if ( num_curves ) {
curves = static_cast < EC_builtin_curve * > ( node : : Malloc ( sizeof ( * curves ) ,
num_curves ) ) ;
curves = node : : Malloc < EC_builtin_curve > ( num_curves ) ;
CHECK_NE ( curves , nullptr ) ;