diff options
author | 2018-01-22 19:37:15 -0800 | |
---|---|---|
committer | 2018-01-22 19:37:23 -0800 | |
commit | 443165f88f9c99642e826e17292b3d101ccedf66 (patch) | |
tree | 52d3f9e1439347a83551d8616def3f8c5bdc56ab /src/ruby/ext/grpc/rb_channel.c | |
parent | 6827d4473bc71601fdfc69cabe47a065109c416e (diff) |
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.c | 3 |
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 1d11a53aa7..7f021784e5 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, |