aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-08 22:17:26 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-08 22:17:26 -0800
commitf2afb2ed25595551062373bb803be59f18d32dac (patch)
treeb8e323ca2cedd985bb4628122c20520c99109914 /src/core
parent248904afadfc8eb987d51abbb7f8ea216f548891 (diff)
Fix null pointer dereference
Diffstat (limited to 'src/core')
-rw-r--r--src/core/iomgr/tcp_server_posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c
index a89ee02d34..3716c4e611 100644
--- a/src/core/iomgr/tcp_server_posix.c
+++ b/src/core/iomgr/tcp_server_posix.c
@@ -464,7 +464,9 @@ grpc_tcp_listener *grpc_tcp_server_add_port(grpc_tcp_server *s,
addr_len = sizeof(wild6);
fd = grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, &dsmode);
sp = add_socket_to_server(s, fd, addr, addr_len);
- allocated_port = sp->port;
+ if (sp != NULL) {
+ allocated_port = sp->port;
+ }
if (fd >= 0 && dsmode == GRPC_DSMODE_DUALSTACK) {
goto done;
}