aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/ext/byte_buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/ext/byte_buffer.cc')
-rw-r--r--src/node/ext/byte_buffer.cc4
1 files changed, 2 insertions, 2 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);