aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-09-12 09:57:07 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-09-12 09:57:07 -0700
commitfc2636d7a66cc39596dbaebb1813adc93191290d (patch)
tree86c070c8469f19e36aa11d0fa1b0855b6f95d2c0 /test/core/end2end/tests
parentdf844f8a5cffafec36fb319c8f41bc11c9702a69 (diff)
Fix resource leak
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r--test/core/end2end/tests/payload.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c
index c37d7fe41a..ed1c719ef8 100644
--- a/test/core/end2end/tests/payload.c
+++ b/test/core/end2end/tests/payload.c
@@ -99,11 +99,11 @@ static void end_test(grpc_end2end_test_fixture *f) {
static gpr_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
- char output[1024 * 1024]; /* 1 MB */
- for (i = 0; i < 1024 * 1024 - 1; ++i) {
+ char output[1024 * 1024];
+ for (i = 0; i < GPR_ARRAY_SIZE(output) - 1; ++i) {
output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
}
- output[1024 * 1024 - 1] = '\0';
+ output[GPR_ARRAY_SIZE(output) - 1] = '\0';
return gpr_slice_from_copied_string(output);
}