Explorar el Código

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

Octavio Valle hace 2 años
padre
commit
ff34749572
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      httplib.h

+ 1 - 1
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);