aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/ext
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2017-06-08 18:21:09 +0200
committerGravatar Jan Tattermusch <jtattermusch@google.com>2017-06-08 18:33:36 +0200
commit06eb057eb76d62ca6ee0987b9b2fae1befbff78a (patch)
treec763cef356b13df447064c682cc3c3a166060f76 /src/csharp/ext
parent52bcda9fb383093845ad064c05da85f9420def0a (diff)
add grpc_slice_unref to fix leaks
Diffstat (limited to 'src/csharp/ext')
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c14
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