From 3153e5af0cda0755d927f281f6561eb52279ced1 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 7 Dec 2016 16:25:26 -0800 Subject: [PATCH] Fix memory leak --- src/core/lib/security/transport/server_auth_filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/lib/security/transport/server_auth_filter.c b/src/core/lib/security/transport/server_auth_filter.c index 4433704cb97..cddc5d90863 100644 --- a/src/core/lib/security/transport/server_auth_filter.c +++ b/src/core/lib/security/transport/server_auth_filter.c @@ -137,6 +137,10 @@ static void on_md_processing_done( grpc_slice message; grpc_transport_stream_op *close_op = gpr_malloc(sizeof(*close_op)); memset(close_op, 0, sizeof(*close_op)); + for (size_t i = 0; i < calld->md.count; i++) { + grpc_slice_unref_internal(&exec_ctx, calld->md.metadata[i].key); + grpc_slice_unref_internal(&exec_ctx, calld->md.metadata[i].value); + } grpc_metadata_array_destroy(&calld->md); error_details = error_details != NULL ? error_details