From 587218a2548369adabbc0f7255e5c7ad31337437 Mon Sep 17 00:00:00 2001 From: Kevin Sweeney Date: Tue, 26 Feb 2019 10:25:49 +0000 Subject: [PATCH] Fix channel credentials memory leak in shims (#369) --- Sources/CgRPC/shim/channel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/CgRPC/shim/channel.c b/Sources/CgRPC/shim/channel.c index 451c97d5c..d632add53 100644 --- a/Sources/CgRPC/shim/channel.c +++ b/Sources/CgRPC/shim/channel.c @@ -57,6 +57,9 @@ cgrpc_channel *cgrpc_channel_create_secure(const char *address, c->channel = grpc_secure_channel_create(creds, address, &channel_args, NULL); c->completion_queue = grpc_completion_queue_create_for_next(NULL); + + grpc_channel_credentials_release(creds); + return c; } @@ -73,6 +76,9 @@ cgrpc_channel *cgrpc_channel_create_google(const char *address, c->channel = grpc_secure_channel_create(google_creds, address, &channel_args, NULL); c->completion_queue = grpc_completion_queue_create_for_next(NULL); + + grpc_channel_credentials_release(google_creds); + return c; }