From b73ad23bd82b69e21a2ce6a2f8b422ab99570b19 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Mon, 27 Feb 2017 15:57:24 -0800
Subject: [PATCH] Fix memory leak

---
 test/core/support/spinlock_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/core/support/spinlock_test.c b/test/core/support/spinlock_test.c
index 20b402a705..c70e76c7ea 100644
--- a/test/core/support/spinlock_test.c
+++ b/test/core/support/spinlock_test.c
@@ -70,7 +70,10 @@ static struct test *test_new(int threads, int64_t iterations, int incr_step) {
 }
 
 /* Return pointer to a new struct test. */
-static void test_destroy(struct test *m) { gpr_free(m); }
+static void test_destroy(struct test *m) {
+  gpr_free(m->threads);
+  gpr_free(m);
+}
 
 /* Create m->threads threads, each running (*body)(m) */
 static void test_create_threads(struct test *m, void (*body)(void *arg)) {
-- 
GitLab