From c2dd2a2be965d3d12a43313aa530fa1455fd4724 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Fri, 14 Oct 2016 07:54:23 -0700
Subject: [PATCH] Fix potential crash

---
 src/core/lib/iomgr/closure.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/core/lib/iomgr/closure.c b/src/core/lib/iomgr/closure.c
index 2c84e82aca..c6ddc76732 100644
--- a/src/core/lib/iomgr/closure.c
+++ b/src/core/lib/iomgr/closure.c
@@ -116,7 +116,9 @@ grpc_closure *grpc_closure_create(grpc_iomgr_cb_func cb, void *cb_arg) {
 void grpc_closure_run(grpc_exec_ctx *exec_ctx, grpc_closure *c,
                       grpc_error *error) {
   GPR_TIMER_BEGIN("grpc_closure_run", 0);
-  c->cb(exec_ctx, c->cb_arg, error);
+  if (c != NULL) {
+    c->cb(exec_ctx, c->cb_arg, error);
+  }
   GRPC_ERROR_UNREF(error);
   GPR_TIMER_END("grpc_closure_run", 0);
 }
-- 
GitLab