From ff34749572e433450263083771450a171a0055ff Mon Sep 17 00:00:00 2001 From: Octavio Valle Date: Mon, 3 Apr 2023 12:28:01 -0300 Subject: [PATCH] Initialize sockaddr_un to fix valgrind uninitialised byte message. (#1547) --- httplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 842a51e..d7c808c 100644 --- a/httplib.h +++ b/httplib.h @@ -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);