diff options
Diffstat (limited to 'src/node/ext')
-rw-r--r-- | src/node/ext/byte_buffer.cc | 4 | ||||
-rw-r--r-- | src/node/ext/node_grpc.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc index c306292c04..ee703fdc91 100644 --- a/src/node/ext/byte_buffer.cc +++ b/src/node/ext/byte_buffer.cc @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,7 +69,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) { return scope.Escape(Nan::Null()); } size_t length = grpc_byte_buffer_length(buffer); - char *result = reinterpret_cast<char *>(calloc(length, sizeof(char))); + char *result = new char[length]; size_t offset = 0; grpc_byte_buffer_reader reader; grpc_byte_buffer_reader_init(&reader, buffer); diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc index a2b8e0d22b..654c5aed09 100644 --- a/src/node/ext/node_grpc.cc +++ b/src/node/ext/node_grpc.cc @@ -112,8 +112,8 @@ void InitCallErrorConstants(Local<Object> exports) { Nan::Set(exports, Nan::New("callError").ToLocalChecked(), call_error); Local<Value> OK(Nan::New<Uint32, uint32_t>(GRPC_CALL_OK)); Nan::Set(call_error, Nan::New("OK").ToLocalChecked(), OK); - Local<Value> ERROR(Nan::New<Uint32, uint32_t>(GRPC_CALL_ERROR)); - Nan::Set(call_error, Nan::New("ERROR").ToLocalChecked(), ERROR); + Local<Value> CALL_ERROR(Nan::New<Uint32, uint32_t>(GRPC_CALL_ERROR)); + Nan::Set(call_error, Nan::New("ERROR").ToLocalChecked(), CALL_ERROR); Local<Value> NOT_ON_SERVER( Nan::New<Uint32, uint32_t>(GRPC_CALL_ERROR_NOT_ON_SERVER)); Nan::Set(call_error, Nan::New("NOT_ON_SERVER").ToLocalChecked(), |