Remember to unref the slice

This commit is contained in:
murgatroid99 2016-05-25 15:19:09 -07:00
parent af02b8c087
commit 717dc41926
1 changed files with 1 additions and 0 deletions

View File

@ -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()));
}