Commit c1585ed8 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Bind with refs rather than pointers

Summary: This silences HowToEven's nullability warning.

Reviewed By: yfeldblum

Differential Revision: D12889459

fbshipit-source-id: c460bf3bbb6c4c10df5a2aabbf99689c31bc2d21
parent 0ec1d370
......@@ -148,8 +148,8 @@ void AsyncUDPSocket::bind(const folly::SocketAddress& address) {
// bind to the address
sockaddr_storage addrStorage;
address.getAddress(&addrStorage);
sockaddr* saddr = reinterpret_cast<sockaddr*>(&addrStorage);
if (netops::bind(socket, saddr, address.getActualSize()) != 0) {
auto& saddr = reinterpret_cast<sockaddr&>(addrStorage);
if (netops::bind(socket, &saddr, address.getActualSize()) != 0) {
throw AsyncSocketException(
AsyncSocketException::NOT_OPEN,
"failed to bind the async udp socket for:" + address.describe(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment