diff options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannelPool.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCChannelPool.m | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m index 7c0a8a8621..740eeaf6cf 100644 --- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m +++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m @@ -36,8 +36,8 @@ extern const char *kCFStreamVarName; - (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions { if ((self = [super init])) { - _host = host; - _callOptions = callOptions; + _host = [host copy]; + _callOptions = [callOptions copy]; } return self; } @@ -56,9 +56,8 @@ extern const char *kCFStreamVarName; privateKey:_callOptions.PEMPrivateKey certChain:_callOptions.PEMCertChain error:&error]; - if (error) { + if (factory == nil) { NSLog(@"Error creating secure channel factory: %@", error); - return nil; } return factory; #ifdef GRPC_COMPILE_WITH_CRONET |