aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node
diff options
context:
space:
mode:
authorGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-09-17 12:20:58 -0700
committerGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-09-17 12:20:58 -0700
commit1965810ede1dae0aaf72d55e1359e640d08720f8 (patch)
tree212767340a11f9763fab14de097cb97a14c2749b /src/node
parent3c142b8bcc6b87d34854772816553825a8705bdf (diff)
parent640325e65eb52c213be8349b7f4400cf4cc7f62e (diff)
Merge pull request #3341 from murgatroid99/node_memory_leak_0_11
Fixed a couple of memory leaks in Node library
Diffstat (limited to 'src/node')
-rw-r--r--src/node/ext/byte_buffer.cc2
-rw-r--r--src/node/ext/call.cc5
-rw-r--r--src/node/ext/call.h2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index 7eff11c2b3..fe7735d429 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -77,7 +77,7 @@ Handle<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
memcpy(result + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
}
- return NanEscapeScope(MakeFastBuffer(NanNewBufferHandle(result, length)));
+ return NanEscapeScope(MakeFastBuffer(NanBufferUse(result, length)));
}
Handle<Value> MakeFastBuffer(Handle<Value> slowBuffer) {
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
index 560869e6fa..49b306202b 100644
--- a/src/node/ext/call.cc
+++ b/src/node/ext/call.cc
@@ -172,6 +172,9 @@ Handle<Value> Op::GetOpType() const {
return NanEscapeScope(NanNew<String>(GetTypeString()));
}
+Op::~Op() {
+}
+
class SendMetadataOp : public Op {
public:
Handle<Value> GetNodeValue() const {
@@ -325,7 +328,7 @@ class ReadMessageOp : public Op {
}
~ReadMessageOp() {
if (recv_message != NULL) {
- gpr_free(recv_message);
+ grpc_byte_buffer_destroy(recv_message);
}
}
Handle<Value> GetNodeValue() const {
diff --git a/src/node/ext/call.h b/src/node/ext/call.h
index 89f81dcf4d..a01f03489e 100644
--- a/src/node/ext/call.h
+++ b/src/node/ext/call.h
@@ -88,6 +88,7 @@ struct Resources {
class Op {
public:
+ virtual ~Op();
virtual v8::Handle<v8::Value> GetNodeValue() const = 0;
virtual bool ParseOp(v8::Handle<v8::Value> value, grpc_op *out,
shared_ptr<Resources> resources) = 0;
@@ -98,7 +99,6 @@ class Op {
};
typedef std::vector<unique_ptr<Op>> OpVec;
-
struct tag {
tag(NanCallback *callback, OpVec *ops,
shared_ptr<Resources> resources);