diff options
author | Julien Boeuf <jboeuf@google.com> | 2015-02-17 15:51:43 -0800 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2015-02-17 15:51:43 -0800 |
commit | 5882b53e9426fb9a55cfc2bf8f9ad09e1feb49df (patch) | |
tree | 4172a38e297920d38decbbb920b40e5dafd7b350 /src | |
parent | 30313622ac6c4be7dec19324e6952e4e4d3e56eb (diff) |
Fixing memleak.
- Fixes #542
Diffstat (limited to 'src')
-rw-r--r-- | src/core/security/security_context.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c index adb0269792..1909617614 100644 --- a/src/core/security/security_context.c +++ b/src/core/security/security_context.c @@ -349,11 +349,13 @@ static grpc_security_status ssl_channel_check_peer(grpc_security_context *ctx, void *user_data) { grpc_ssl_channel_security_context *c = (grpc_ssl_channel_security_context *)ctx; - grpc_security_status status = ssl_check_peer(c->overridden_target_name != NULL - ? c->overridden_target_name - : c->target_name, - &peer); + grpc_security_status status; + tsi_peer_destruct(&c->peer); c->peer = peer; + status = ssl_check_peer(c->overridden_target_name != NULL + ? c->overridden_target_name + : c->target_name, + &peer); return status; } |