From 2138362443493cffc919f37e3a0045cb6521dccd Mon Sep 17 00:00:00 2001 From: Zhouyihai Ding Date: Tue, 23 Jan 2018 20:50:06 -0800 Subject: [PATCH] php: fix channel_credentials hashstr leak --- src/php/ext/grpc/channel_credentials.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index ed74b991bd9..6ae21eac62d 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -57,6 +57,10 @@ static grpc_ssl_roots_override_result get_ssl_roots_override( /* Frees and destroys an instance of wrapped_grpc_channel_credentials */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel_credentials) + if (p->hashstr != NULL) { + free(p->hashstr); + p->hashstr = NULL; + } if (p->wrapped != NULL) { grpc_channel_credentials_release(p->wrapped); p->wrapped = NULL;