Sfoglia il codice sorgente

Fix two memory leaks and update a link in the README. (#501)

Fixes #340.
Daniel Alm 6 anni fa
parent
commit
7c9a83c424

+ 1 - 1
Examples/Google/NaturalLanguage/README.md

@@ -1,7 +1,7 @@
 # Calling the Google Cloud Natural Language API
 
 This directory contains a very simple sample that calls the 
-[Google Cloud Natural Language API](https://cloud.google.com/datastore/docs/reference/rpc/google.datastore.v1).
+[Google Cloud Natural Language API](https://cloud.google.com/natural-language/docs/reference/rpc/google.cloud.language.v1).
 Calls are made directly to the Cloud Natural Language RPC interface. 
 In practice, these would be wrapped in idiomatic code.
 

+ 2 - 0
Sources/CgRPC/shim/channel_shim.c

@@ -56,6 +56,7 @@ cgrpc_channel *cgrpc_channel_create_secure(const char *address,
   grpc_channel_credentials *creds = grpc_ssl_credentials_create(pem_root_certs, client_credentials_pointer, NULL, NULL);
 
   c->channel = grpc_secure_channel_create(creds, address, &channel_args, NULL);
+  grpc_channel_credentials_release(creds);
   c->completion_queue = grpc_completion_queue_create_for_next(NULL);
   return c;
 }
@@ -72,6 +73,7 @@ cgrpc_channel *cgrpc_channel_create_google(const char *address,
   grpc_channel_credentials *google_creds = grpc_google_default_credentials_create();
 
   c->channel = grpc_secure_channel_create(google_creds, address, &channel_args, NULL);
+  grpc_channel_credentials_release(google_creds);
   c->completion_queue = grpc_completion_queue_create_for_next(NULL);
   return c;
 }