From 93da6ac64742002e60f009057a74de6d848e8ab1 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 21 Jan 2015 18:05:07 -0800 Subject: [PATCH] Fix memory corruption if >2 ports --- src/core/iomgr/tcp_server_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index 5762eb8a970..e6c02186eea 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -252,7 +252,7 @@ static int add_socket_to_server(grpc_tcp_server *s, int fd, if (s->nports == s->port_capacity) { s->port_capacity *= 2; s->ports = - gpr_realloc(s->ports, sizeof(server_port *) * s->port_capacity); + gpr_realloc(s->ports, sizeof(server_port) * s->port_capacity); } sp = &s->ports[s->nports++]; sp->server = s;