diff options
author | Craig Tiller <ctiller@google.com> | 2015-12-08 22:17:26 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-12-08 22:17:26 -0800 |
commit | f2afb2ed25595551062373bb803be59f18d32dac (patch) | |
tree | b8e323ca2cedd985bb4628122c20520c99109914 /src/core | |
parent | 248904afadfc8eb987d51abbb7f8ea216f548891 (diff) |
Fix null pointer dereference
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/iomgr/tcp_server_posix.c | 4 |
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; } |