summaryrefslogtreecommitdiff
path: root/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/handler_socket/libhsclient/auto_addrinfo.hpp')
-rw-r--r--plugin/handler_socket/libhsclient/auto_addrinfo.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
index 6a807a6fcc7..aee22a1d0f6 100644
--- a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
+++ b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
@@ -13,7 +13,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
-
+#include <string.h>
#include "util.hpp"
typedef SOCKET_SIZE_TYPE size_socket;
@@ -34,8 +34,9 @@ struct auto_addrinfo : private noncopyable {
const addrinfo *get() const { return addr; }
int resolve(const char *node, const char *service, int flags = 0,
int family = AF_UNSPEC, int socktype = SOCK_STREAM, int protocol = 0) {
+ addrinfo hints;
reset();
- addrinfo hints = { };
+ memset(&hints, 0, sizeof(hints));
hints.ai_flags = flags;
hints.ai_family = family;
hints.ai_socktype = socktype;