From 8a10abaf85c976dfce03332de5d8aaf4781d4870 Mon Sep 17 00:00:00 2001 From: Hans-Christian Noren Egtvedt Date: Wed, 9 Dec 2020 10:42:59 +0100 Subject: [PATCH] connect: zero variable on stack to silence valgrind complaint Valgrind will complain that ssrem buffer usage if not explicit initialized, hence initialize it to zero. This completes the change intially started in commit 2c0d7212151 ('ftp: retry getpeername for FTP with TCP_FASTOPEN') where the ssloc buffer has a similar memset to zero. Signed-off-by: Hans-Christian Noren Egtvedt Closes #6289 --- lib/connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/connect.c b/lib/connect.c index e65d24d9e..6e4608d98 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -680,6 +680,7 @@ void Curl_conninfo_remote(struct connectdata *conn, curl_socket_t sockfd) struct Curl_sockaddr_storage ssrem; curl_socklen_t plen; plen = sizeof(struct Curl_sockaddr_storage); + memset(&ssrem, 0, sizeof(ssrem)); if(getpeername(sockfd, (struct sockaddr*) &ssrem, &plen)) { int error = SOCKERRNO; failf(conn->data, "getpeername() failed with errno %d: %s",