diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 6b5e891e14d..0fcbed66fcf 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -576,7 +576,7 @@ static int prepare_application_metadata(grpc_call *call, int count, } if (i != count) { for (int j = 0; j <= i; j++) { - grpc_metadata *md = &metadata[i]; + grpc_metadata *md = &metadata[j]; grpc_linked_mdelem *l = (grpc_linked_mdelem *)&md->internal_data; GRPC_MDELEM_UNREF(l->md); }