Remember to unref the slice

pull/6719/head
murgatroid99 9 years ago
parent 8678bb424e
commit c04f7b155b
  1. 1
      src/node/ext/byte_buffer.cc

@ -78,6 +78,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
size_t length = GPR_SLICE_LENGTH(slice);
char *result = new char[length];
memcpy(result, GPR_SLICE_START_PTR(slice), length);
gpr_slice_unref(slice);
return scope.Escape(MakeFastBuffer(
Nan::NewBuffer(result, length, delete_buffer, NULL).ToLocalChecked()));
}

Loading…
Cancel
Save