Skip to content
Snippets Groups Projects
Commit c04f7b15 authored by murgatroid99's avatar murgatroid99
Browse files

Remember to unref the slice

parent 8678bb42
No related branches found
No related tags found
Loading
...@@ -78,6 +78,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) { ...@@ -78,6 +78,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
size_t length = GPR_SLICE_LENGTH(slice); size_t length = GPR_SLICE_LENGTH(slice);
char *result = new char[length]; char *result = new char[length];
memcpy(result, GPR_SLICE_START_PTR(slice), length); memcpy(result, GPR_SLICE_START_PTR(slice), length);
gpr_slice_unref(slice);
return scope.Escape(MakeFastBuffer( return scope.Escape(MakeFastBuffer(
Nan::NewBuffer(result, length, delete_buffer, NULL).ToLocalChecked())); Nan::NewBuffer(result, length, delete_buffer, NULL).ToLocalChecked()));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment