Initialize sockaddr_un to fix valgrind uninitialised byte message. (#1547)

This commit is contained in:
Octavio Valle
2023-04-03 08:28:01 -07:00
committed by GitHub
parent e5804d4a50
commit ff34749572
+1 -1
View File
@@ -2668,7 +2668,7 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port,
auto sock = socket(hints.ai_family, hints.ai_socktype, hints.ai_protocol);
if (sock != INVALID_SOCKET) {
sockaddr_un addr;
sockaddr_un addr {};
addr.sun_family = AF_UNIX;
std::copy(host.begin(), host.end(), addr.sun_path);