summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index be6f1ad91a..892e7f12a3 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -328,6 +328,8 @@ socket_open(socket_st * hd, const char *hostname, const char *service,
char portname[16] = { 0 };
char *a_hostname = (char*)hostname;
+ memset(hd, 0, sizeof(*hd));
+
#ifdef HAVE_LIBIDN
err = idna_to_ascii_8z(hostname, &a_hostname, IDNA_ALLOW_UNASSIGNED);
if (err != IDNA_SUCCESS) {