diff options
author | apolcyn <apolcyn@google.com> | 2018-02-08 18:56:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-08 18:56:37 -0800 |
commit | f3431e5b219dd0bfac52d60cbb7d8b8e3987953f (patch) | |
tree | 0c4904a49e07bc2a61a9456bb3372e50c195d3b2 /src/ruby/ext/grpc/rb_channel.c | |
parent | 063d5de052af0280b415526e06287190ba909ed2 (diff) | |
parent | 443165f88f9c99642e826e17292b3d101ccedf66 (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.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 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, |