aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext/grpc/rb_channel.c
diff options
context:
space:
mode:
authorGravatar apolcyn <apolcyn@google.com>2018-02-08 18:56:37 -0800
committerGravatar GitHub <noreply@github.com>2018-02-08 18:56:37 -0800
commitf3431e5b219dd0bfac52d60cbb7d8b8e3987953f (patch)
tree0c4904a49e07bc2a61a9456bb3372e50c195d3b2 /src/ruby/ext/grpc/rb_channel.c
parent063d5de052af0280b415526e06287190ba909ed2 (diff)
parent443165f88f9c99642e826e17292b3d101ccedf66 (diff)
Merge pull request #14132 from apolcyn/fix_benign_compression_options_mem_leak
Fix two ruby memory leaks when exceptions are raised
Diffstat (limited to 'src/ruby/ext/grpc/rb_channel.c')
-rw-r--r--src/ruby/ext/grpc/rb_channel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index c56ac21645..e8bfeb32a0 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -427,16 +427,15 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent, VALUE mask,
parent_call = grpc_rb_get_wrapped_call(parent);
}
- cq = grpc_completion_queue_create_for_pluck(NULL);
TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
if (wrapper->bg_wrapped == NULL) {
rb_raise(rb_eRuntimeError, "closed!");
return Qnil;
}
+ cq = grpc_completion_queue_create_for_pluck(NULL);
method_slice =
grpc_slice_from_copied_buffer(RSTRING_PTR(method), RSTRING_LEN(method));
-
call = grpc_channel_create_call(wrapper->bg_wrapped->channel, parent_call,
flags, cq, method_slice, host_slice_ptr,
grpc_rb_time_timeval(deadline,