Skip to content

Commit

Permalink
Fix channel credentials memory leak in shims (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevints authored and MrMage committed Feb 26, 2019
1 parent 5f24269 commit 587218a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/CgRPC/shim/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 587218a

Please sign in to comment.