diff options
author | Seongjin Cho <sjcho@wisefour.com> | 2015-12-01 11:13:15 +0900 |
---|---|---|
committer | Seongjin Cho <sjcho@wisefour.com> | 2015-12-01 11:13:15 +0900 |
commit | 5c3d571c1af386940968e2d457e5fd35731ac51c (patch) | |
tree | 8ae510122dd85f3bafd7e48d06e483473c2d97f7 /src | |
parent | 8b77d61d8ff204780770e8e2a13b586526f3ef3b (diff) |
Fixes memory leak when receiving data
Diffstat (limited to 'src')
-rw-r--r-- | src/node/ext/byte_buffer.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc index e1786ddba7..c306292c04 100644 --- a/src/node/ext/byte_buffer.cc +++ b/src/node/ext/byte_buffer.cc @@ -77,6 +77,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) { while (grpc_byte_buffer_reader_next(&reader, &next) != 0) { memcpy(result + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next)); offset += GPR_SLICE_LENGTH(next); + gpr_slice_unref(next); } return scope.Escape(MakeFastBuffer( Nan::NewBuffer(result, length).ToLocalChecked())); |