From c6a7c6e02cdf52c0ff99f4451923e3858db74ed4 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 19 Nov 2015 21:55:44 +0100 Subject: Fixing use after free under Posix (was already fixed for Windows.) --- src/core/iomgr/tcp_server_posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index fbc0e974e6..5daf406c99 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -144,13 +144,13 @@ grpc_tcp_server *grpc_tcp_server_create(void) { } static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { - grpc_tcp_listener *sp; - grpc_exec_ctx_enqueue(exec_ctx, s->shutdown_complete, 1); gpr_mu_destroy(&s->mu); - for (sp = s->head; sp; sp = sp->next) { + while (s->head) { + grpc_tcp_listener *sp = s->head; + s->head = sp->next; grpc_tcp_listener_unref(sp); } -- cgit v1.2.3