diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2017-06-08 18:21:09 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2017-06-08 18:33:36 +0200 |
commit | 06eb057eb76d62ca6ee0987b9b2fae1befbff78a (patch) | |
tree | c763cef356b13df447064c682cc3c3a166060f76 /src | |
parent | 52bcda9fb383093845ad064c05da85f9420def0a (diff) |
add grpc_slice_unref to fix leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/csharp/ext/grpc_csharp_ext.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index a56113eca3..8cde8ff0c0 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -413,8 +413,14 @@ GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call( host_slice = grpc_slice_from_copied_string(host); host_slice_ptr = &host_slice; } - return grpc_channel_create_call(channel, parent_call, propagation_mask, cq, - method_slice, host_slice_ptr, deadline, NULL); + grpc_call *ret = + grpc_channel_create_call(channel, parent_call, propagation_mask, cq, + method_slice, host_slice_ptr, deadline, NULL); + grpc_slice_unref(method_slice); + if (host != NULL) { + grpc_slice_unref(host_slice); + } + return ret; } GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE @@ -805,7 +811,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( ops[nops].reserved = NULL; nops++; } - return grpcsharp_call_start_batch(call, ops, nops, ctx, NULL); + grpc_call_error ret = grpcsharp_call_start_batch(call, ops, nops, ctx, NULL); + grpc_slice_unref(status_details_slice); + return ret; } GPR_EXPORT grpc_call_error GPR_CALLTYPE |