From 361489496541ce51dab11599b441d36852720093 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Apr 2017 17:45:08 +0000 Subject: [PATCH] Fix mem leaks --- src/core/lib/iomgr/ev_epollex_linux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c index 88b7c83933c..db35e0e11f8 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.c +++ b/src/core/lib/iomgr/ev_epollex_linux.c @@ -1078,7 +1078,11 @@ static void pg_join(grpc_exec_ctx *exec_ctx, polling_group *pg, static void pg_merge(grpc_exec_ctx *exec_ctx, polling_group *a, polling_group *b) { for (;;) { - if (a == b) return; + if (a == b) { + pg_unref(a); + pg_unref(b); + return; + } if (a > b) GPR_SWAP(polling_group *, a, b); gpr_mu_lock(&a->po.mu); gpr_mu_lock(&b->po.mu); @@ -1128,6 +1132,7 @@ static void pg_merge(grpc_exec_ctx *exec_ctx, polling_group *a, pg_unref(unref[i]); } gpr_free(unref); + pg_unref(b); } /*******************************************************************************